I am using JQuery
's DatePicker
API to select value from text box.
Here is call to DatePicker
$(".datefield").datepicker({
changeMonth: true,
changeYear: true,
dateFormat: 'dd-M-yy'
});
and I am also using jQuery.Validate
to validate user input as below
$("#form_assetDetails").validate({
// Specify the validation rules
rules: {
Make: { required: true, maxlength: 30 },
ModelName: { required: true, maxlength: 30 },
WarrantyDetail: { required: true, maxlength: 100 },
Capacity: { maxlength: 90 },
WarrantyEndDate: { required: true, date: true },
Quantity: { required: true, number: true, range: [1, 999] },
PurchaseOrderNumber: { required: true, maxlength: 20 },
InvoiceNumber: { required: true, maxlength: 20 },
InvoiceDate: { required: true, date: true },
AdvanceAmount: { required: false, number: true, range: [0, 9999999] },
FinalAmount: { required: true, number: true, range: [0, 9999999] }
},
// Specify the validation error messages
messages: {
//Make: "Please enter asset make"
},
submitHandler: function (form) {
form.submit();
}
});
for those control that are meant to take date as input, every validation works fine in chrome but when it comes to IE11
, it always fails validation.
I tried different format i.e dd/mm/yyyy
and it works but why it does not work with current format?