I got round the problem using a hidden altField:
<div id="DatePicker"></div>
<input type="hidden" value="" name="Date" id="Date" />
and the following script:
<script>
$(function () {
$('#DatePicker').datepicker({
altField: '#Date', // ID of the hidden field
altFormat: 'dd/mm/yy'
});
// Remove the style for the default selected day (today)
$('.ui-datepicker-current-day').removeClass('ui-datepicker-current-day');
// Reset the current selected day
$('#Date').val('');
});
</script>
Then, I used the hidden #Date field in my validation routines.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…