Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

278
Views
Bootstrap datepicker, autofill to and disable typing on select date

Rails datepicker Autofil to field with 10 days from the selected date on from field

$('.datepicker').datepicker({format: "yyyy/mm/dd"})

<div class="bg-body-light mb-3 ">
<%= form_tag profile_path, method: "get" do |f| %>
    <%= hidden_field :daily, :value => true %>
        <div class="fields"> 
                <div class="form-row align-items-center  m-3  pt-3">
                    <div class="col-auto"> 
                        <p>   
                            <strong><%= I18n.t 'profile.form.from' %></strong>  
                            <%= text_field 'from',nil, class: 'form-control datepicker',placeholder: (I18n.t 'profile.form.from')  %>
                        </p>

                    </div>  
                    <div class="col-auto"> 
                        <p>   
                            <strong><%= I18n.t 'profile.form.to' %></strong>  
                            <%= text_field 'to',nil, class: 'form-control datepicker',placeholder: (I18n.t 'profile.form.to')  %>
                        </p>

                    </div>  
                    <div class="col-auto"> 
                            <%= button_tag( class: "btn btn-sm btn-outline-primary btn-rounded search-button-style") do %>
                                    <i class="fa fa-search"></i>
                                    <span><%= I18n.t 'search' %><span>
                            <% end %>
                    </div>
                </div>  
        </div>  
<% end %>

I have added a datepicker field on rails view. (from and to fields). This is my form. I want the to field automatically filled once I select the date on from field with 10 days later.from=(2020/01/20) then to field to be auto to(2020/01/30). Also I donot want to use date-select, because i need it in same design that It is now, but Can I disable the input field with only select the datepicker but no typing of any string?

about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!