Datepicker does not pass date to database
Hi,
I'm trying to apply Datepicker to my User Registration Form. Inserted DatePicker into the "Date of Birth" field, applied date format 'yy-mm-dd' (the same as on database). Database field type is set "Date", the scrip is as follows:
$(function(){
$('#datepicker_1').datepicker({
dateFormat: 'yy-mm-dd',
showAnim: 'fade',
onClose: closeDatePicker_datepicker_1,
changeYear: true,
yearRange: '1850:+01'
});
});
function closeDatePicker_datepicker_1() {
var tElm = $('#datepicker_1');
if (typeof datepicker_1_Spry != null && typeof datepicker_1_Spry != "undefined") {
datepicker_1_Spry.validate();
}
var docElm = document.getElementById("datepicker_1");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = tBlur.replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
----------------------------------------------------
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">GrBirthDate:</td>
<td><input id="datepicker_1" name="GrBirthDay" type="text" /></td>
</tr>
Can not get the date into the database, no value appears. Tried without Datepicker it works perfectly just I need to type in format 'yyyy-mm-dd'. Tried changing format to 'yyyy-mm-dd' for datepicker still no values go through to datase.
What am I doing wrong?