0

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?

Imad
  • 7,126
  • 12
  • 55
  • 112
  • 1
    Check [Custom date format with jQuery validation plugin](http://stackoverflow.com/questions/511439/custom-date-format-with-jquery-validation-plugin) – Mivaweb Jun 29 '15 at 09:31
  • 1
    Thanx @Mivaweb http://stackoverflow.com/a/4812304/3664659 was helpful – Imad Jun 29 '15 at 12:39

0 Answers0