Jason below is 3 bits of code on the insert page and after that is the code on the page that displays the date (update page).
INSERT PAGE
// manual insertion re posting date in European format
if(isset($_POST['DOB'])) {
$_POST['DOB'] = date("Y-m-d", strtotime(str_replace("/","-",$_POST['DOB'] )));
}
?>
<script type="text/javascript">
$(function(){
$('#DOB').datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd/mm/yy',
yearRange: "1900:2012",
maxDate: 0,
minDate: new Date(1900, 1 - 1,1),
showAnim: 'show',
onClose: closeDatePicker_DOB
});
});
function closeDatePicker_DOB() {
var tElm = $('#DOB');
if (typeof DOB_Spry != null && typeof DOB_Spry != "undefined" && DOB_Spry.validate) {
DOB_Spry.validate();
}
var docElm = document.getElementById("DOB");
var tBlur = docElm.getAttribute("onBlur");
if (!tBlur) tBlur = docElm.getAttribute("onblur");
if (!tBlur) tBlur = docElm.getAttribute("ONBLUR");
if (tBlur) {
tBlur = String(tBlur).replace(/\bthis\b/g, "docElm");
eval(tBlur);
}
}
</script>
<input id="DOB" name="DOB" type="text" value="<?php echo((isset($_GET["invalid"])?ValidatedField("addmember","DOB"):"")); ?>" class="formTextfield_Medium" tabindex="6" onblur="hideServerError('DOB_ServerError');"/>
_________________________________________________________________________
UPDATE/DETAILS Page - which displays the date
<div class="fieldGroup"> <span id="DOB_Spry"> <span>
<input id="DOB" name="DOB" type="text" value="<?php echo(date("d/m/Y", strtotime($row_rsMembers_Update['memberDOB']))); ?>" class="formTextfield_Medium" tabindex="6" onblur="hideServerError('DOB_ServerError');"/>
<span class="textfieldInvalidFormatMsg">Invalid format.</span><span class="textfieldRequiredMsg">Please enter or select a date</span> </span> </span>
<?php
if (ValidatedField('updatemember','updatemember')) {
if ((strpos((",".ValidatedField("updatemember","updatemember").","), "," . "5" . ",") !== false || "5" == "")) {
if (!(false)) {
?>
<span class="serverInvalidState" id="DOB_ServerError">Please enter or select a date</span>
<?php //WAFV_Conditional update_member.php updatemember(5:)
}
}
}?>
</div>
</div>
</div>
</div>
</div>