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

  • SEARCH
  • Home
  • 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 6359097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:28:27+00:00 2026-05-24T23:28:27+00:00

When I submit my form I can see the date being sent to in

  • 0

When I submit my form I can see the date being sent to in the post. However, It doesn’t save the date. If I do a date check it says it is not in the proper format. Here is my date picker function, it displays fine:

    $j(function(){
    $j("#mile_date").datepicker();
});

the $j is because I am using prototype as well so all jquery calls are using the the noconflict variable.

Here is the post:

 Parameters: {"utf8"=>"Γ£ô", "authenticity_token"=>"Fj4HW/B4EOan/vcPZLJ75TvWkRH4ZKSFsPLlQLSD0cI=", "mile"=>{"odometer"=>"", "trip"=>"428.2
", "gallons"=>"24.959", "note"=>"", "temperature"=>"", "date"=>"06/22/2011"}, "commit"=>"Create Mile"}

So it sends the date fine but rails doesn’t seem to like the format. It inserts a null value into the database. If I submit it with the default datefield with the drop downs it sends this and saves fine:

    Parameters: {"utf8"=>"Γ£ô", "authenticity_token"=>"Fj4HW/B4EOan/vcPZLJ75TvWkRH4ZKSFsPLlQLSD0cI=", "mile"=>{"odometer"=>"", "trip"=>"428.2
", "gallons"=>"24.959", "mpg"=>"17.156136063144", "note"=>"", "temperature"=>"", "date(1i)"=>"2011", "date(2i)"=>"6", "date(3i)"=>"22"}, "c
ommit"=>"Create Mile"}

In the insert statement it inserts the date as:'2011-06-22'

Does Rails expect the date in 3 variables to construct the date format correctly? How can I get the datepicker to send the correct date format?

Thank you in advance,

  • 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-05-24T23:28:27+00:00Added an answer on May 24, 2026 at 11:28 pm

    I ran into the same issue. One solution is to simply change the format that the datepicker uses:

    // in your javascript...
    $j(function(){
      $j("#mile_date").datepicker({
        dateFormat: "yy-mm-dd"
      });
    });
    

    Rails seems to be able to handle the yy-mm-dd format – I’m using that and am having no issues saving the date to the database. The only issue here is that some might find the yy-mm-dd format a little less good looking than mm/dd/yyyy…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I submit jQuery form object (not ajax)? I try form.submit() and it
I'm wondering how can I submit a form via Ajax (using prototype framework) and
When I submit a form in HTML, I can pass a parameter multiple times,
I know that a submit button in HTML can submit a form which opens
I would like to have a form that can submit to two different action
Is there a way I can tell how many times a form submit button
I am newbie to jQuery, can someone explain what this code does: $(#currency form).submit(function(e)
Can anyone see why this would work in FF but not Safari? When I
A friend has pointed me to his old website and says the submit form
I have a problem I can not resolve on a form Here's my view:

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.