Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery date validation in firefox does not working

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

like image 476
Sender Avatar asked Nov 12 '22 02:11

Sender


1 Answers

Suggestion 1

  • Use .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

  • Try to avoid use 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;
});
like image 158
Alex Filatov Avatar answered Nov 15 '22 06:11

Alex Filatov