Apologies for if the question is obvious but I can\'t figure out why it is suddenly not working. I have a jquery datepicker that has been working fine as long as I can remem
a google search gave a lot of results relating to localizing/globalizing asp.net mvc 3 validation.
this article in particular might be on to something:
http://www.hanselman.com/blog/GlobalizationInternationalizationAndLocalizationInASPNETMVC3JavaScriptAndJQueryPart1.aspx
scroll down to: "Globalized jQuery Unobtrusive Validation"
the answer to this question might help as well: Localizing jquery validation with asp.net mvc 3
jQuery allows you to override the different validation functions like so:
$.validator.methods.number = function (value, element) {
return !isNaN($.parseFloat(value));
}
you could do something like this for the date validator, and run it against a regEx for a valid UK date.
You can use the dateFormat, so in your javascript file (after the page is loaded etc.) you can place:
$('.datepicker').datepicker({dateFormat:'yy-mm-dd'});
Try using altFormat instead!
altFormat: "dd/mm/yy",
That works for me : )
EDIT: Try this on JSFiddle http://jsfiddle.net/adover/BRfcK/