I am currently busy on a Asp.net MVC 3 website. There I have a dropdown that sets the culture (nl-BE // en-US)
When I try to parse a date with format 'dd/mm/yyyy' with nl-BE culture, on the SERVER, everything works, but on the client my browser (chrome) keeps on saying that the dateformat "dd/mm/yyyy" is not a correct dateformat. (client side validation)
I tried already with the 'globalize.js' from jquery but stil no succes.
The only way I can fool my browser is to manually add my own validator jQuery.validator.addMethod( 'date', function (value, element, params) { return Date.parseExact(value, "d/M/yyyy"); });
But when I enter following date:25/05/2012 for nl-BE, the browser says ok, but my server throws an error, ( because this wrong format) so its not error proof.
Could someone help for a error proof client side validation that can process dd/mm/yyyy or mm/dd/yyyy
Thanks