I have using mvc4 when i am save click event in firefox and IE 9 given me false value from validation but in chrome working correct.
Date format must be set dd M y
(21 Jun 13) please do not change date formate.
Why this happend i don't know please give me help for this.
Check edit this jsfiddle
NOTE : Please Run In Firefox (my version 20.0.1) OR IE 9
Also i have try different type solution but its does not work for me.
MVC 4: Date validation error in Firefox, Chrome, Safari - IE ok
The field date must be a date in mvc in chrome
Suggestion 1
.datepicker("setDate", 'dd M y');
instead of .datepicker("setDate", "0");
, so your selected date didn't changed. More details you can see on official library page
Suggestion 2
alert()
. Better use console.log()
and debug your code in browser developer console instead of alert()
method.More about browser console methods you can find here
$('#date1').datepicker({
dateFormat: 'dd M y'
}).datepicker("setDate", 'dd M y');
$('#frm-summary-aims').submit(function() {
console.log($(this).valid());
return false;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With