views:

38

answers:

1

hello can anyone tell me why datepicker submits the current date when a input field is empty? i need to have this field empty so if a user does not wish to enter a date, then no data is sent. is there a way to do that? many thanks

A: 

according to the documentation

Set the date to highlight on first opening if the field is blank. Specify either an actual date via a Date object or as a string in the current dateFormat, or a number of days from today (e.g. +7) or a string of values and periods ('y' for years, 'm' for months, 'w' for weeks, 'd' for days, e.g. '+1m +7d'), or null for today.

Code examples

Initialize a datepicker with the defaultDate option specified.
$( ".selector" ).datepicker({ defaultDate: +7 });
Get or set the defaultDate option, after init.
//getter
var defaultDate = $( ".selector" ).datepicker( "option", "defaultDate" );
//setter
$( ".selector" ).datepicker( "option", "defaultDate", +7 );
second
what i need to do is set the default to null. i do not wish a date to be sent if the user bypasses the date field. thanks
mr.putersmit
ok. it was not datepicker that was causing this. i shall repost to php forum. thank you for your help.
mr.putersmit