5

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

Community
  • 1
  • 1
Sender
  • 6,660
  • 12
  • 47
  • 66

1 Answers1

1

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;
});
Alex Filatov
  • 2,232
  • 3
  • 32
  • 39