Im using a datepicker within a form and submitting the form using jquery ajax post.
I have a hidden field RequiredDate, and setting that in the change event for the datepicker
Im then using that in the ajax post
var requiredDate = $("#RequiredDate").val();
The html for my hiden field is:
<input data-val="true" data-val-required="Please select the required date" id="RequiredDate" name="RequiredDate" type="hidden" value="" />
Im allowing hidden field validation using:
$.validator.setDefaults({
ignore: "#InternalColourId, #ExternalColourId, #RequiredDate"
});
I want to be able to validate that a date has been picked (ideally without the use of 3rd party plugins)
Can you help?