Link to home
Start Free TrialLog in
Avatar of peter_coop
peter_coopFlag for United Kingdom of Great Britain and Northern Ireland

asked on

jquery datepicker sending current date if input empty

hello
can anyone tell me why datepicker submits the current date if the input field is empty? this date field is not a compulsory field and can be used at the users discretion. many thanks.
ASKER CERTIFIED SOLUTION
Avatar of dirknibleck
dirknibleck

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of peter_coop

ASKER

thanks for reply. this is the php code:

$date_parts = explode("/",$_POST['datepicker']);
$newDate = $date_parts[2]  . "-" . $date_parts[1] . "-" . $date_parts[0];
$datepicker = date('Y/m/d', strtotime($newDate));
thank you