datepicker field storing all dates to database as 1970-01-01 no matter what user selects?
Can anyone help me decipher why my datepicker field is storing all dates to database as 1970-01-01?
Here's the field....
<input type="text" class="form-control" name="DOB" id="DOB" placeholder="Date of Birth" maxlength="10" value="<?php echo(isset($_GET['v1'])?ValidatedField("healthscreeningform_984","DOB"):$rsEDITFORM->getColumnVal("SMCformDOB")?date("d/m/Y",strtotime($rsEDITFORM->getColumnVal("SMCformDOB"))):"") ?>" required>
Here's the datepicker JS...
<script type="text/javascript">
$(function() {
$( "#DOB" ).datepicker({
dateFormat : 'yy-mm-dd',
changeMonth : true,
changeYear : true,
yearRange: '-100y:c+nn',
maxDate: '-1d'
});
</script>
There are effectively three states this form field can be in....
1) Blank - yet to be filled in by the user
2) Validated value - user has submitted the form, but validation has failed somewhere
3) Recordset value - user is editing the form
The recordset value is converted so that it's displayed in UK format.
Could any of the above be causing this issue?
Hope you can help. Thank you.
NJ