Django Anonymous
Django Anonymous

Reputation: 3025

how to use Jquery UI DatePicker in form processing

I have used Jquery UI DatePicker for the option in my form to select the birthdate.

However, jquery gives a datepicker in <div id="datepicker"></div> tags,

Now i am using it in my form, how can i get its value to make it work for my form processing?

Upvotes: 0

Views: 4723

Answers (2)

rusty009
rusty009

Reputation: 866

if you try setting the id to an input instead of a div,

<input id="datepicker" />

does that work for you?

Upvotes: 1

Alexander
Alexander

Reputation: 23537

Use instead an input field.

<input type="text" id="datepicker" name="mydate"></p>

Also you can user dateFormat option to format the date:

$( "#datepicker" ).datepicker({
  dateFormat: 'yy-mm-dd'
});

Upvotes: 1

Related Questions