Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8428285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T05:00:41+00:00 2026-06-10T05:00:41+00:00

I am using bootstrap-datepicker.js and it is working fine. <div class=well> <div id=dp5 class=input-append

  • 0

I am using bootstrap-datepicker.js and it is working fine.

<div class="well">
<div id="dp5" class="input-append date" data-date-format="dd-mm-yyyy" data-date="12-02-2012">
<input class="span2" type="dp5" readonly="" value="12-02-2012" size="16">
<span class="add-on">
<i class="icon-th"></i>
</span>
</div>

  </div>

I want to use it in my form in rails which is of such type

<%= simple_form_for(@customer) do |f| %>
  <%= f.error_notification %>

  <div class="form-inputs">
    <%= f.input :name %>
    <%= f.input :email %>
    <%= f.input :address %>
    <%= f.input :phone %>
    <%= f.input :Projects %>
     <%= f.radio_button :status, 0, :checked => true%>Publish
    <%= f.radio_button :status, 1 %>Unpublish
    <%= f.radio_button :status, 2 %>Trash


  </div>

  <div class="form-actions">
    <%= f.button :submit %>
  </div>
<% end %>

Here i want to put the date picker inside my form as

`<%f.(datepicker)%>`

so that when i submit my form i get the value of date in the parameter date. When i click on date in datepicker it should hide and the default date should point to the current date. my appication.js includes

 $(function(){  
        $('#dp5').datepicker({
            format: 'mm-dd-yyyy'
        });
        $('#dp3').datepicker({
            format: 'mm-dd-yyyy'
        });


    });
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T05:00:43+00:00Added an answer on June 10, 2026 at 5:00 am

    Use <%= f.text_field :name_of_the_date_column, :value=>Date.today.strftime('%m-%d-%Y'), :id =>"dp5" %>

    To auto hide use this

    $("#dt5").datepicker({
            format: 'mm-dd-yyyy'
        })
    .on('changeDate', function(ev){
      $('#dt5').datepicker('hide');
    });
    

    instead of

    $("#dt5").datepicker();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using bootstrap-datepicker and get a value of 1339698600000 for the selected date
Is there any known method to have a date input working while using Twitter
I create topbar menu using twitter-bootstrap and It working fine .topbar .topbar-inner .container-fluid {{#view
Using Bootstrap Responsive - HTML appears like... <div class=row-fluid Center> <div id=divMapCanvas class=span6> <div
I'm using twitter bootstrap . I have a div with 25 px padding. I
When I create an input box in topbar using bootstrap css, the placeholder value
Using Bootstrap's typeahead javascript plugin, I'm attempting to change the data-source attribute via jQuery's
Using Bootstrap 2.0 I've styled a table using .table-striped. I'm updating rows of data
I'm using bootstrap CSS framework. But unable to find any generic class to apply
I'm using twitter bootstrap and my nav bar works fine with collapse function. This

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.