I used a JQuery Validation script for validating an HTML Form. This worked perfectly in Firefox but doesn't work in IE8. I think there is issue with colon(;) or semi-colon(,)... but I am unable to catch it.
jQuery.validator.addMethod("selectNone", function (value, element) {
if (element.value == "") {
return false;
} else return true;
}, "Please select an option.");
$(document).ready(function () {
$("#formElem").validate({
rules: {
Category: { // "required",simple rule, converted to {required:true}
selectNone: true
},
Repair_technician: { // "required",simple rule, converted to {required:true}
selectNone: true
},
Rework_technician: { // "required",simple rule, converted to {required:true}
selectNone: true
},
Approved_by: { // "required",simple rule, converted to {required:true}
required: true,
},
Part_code: {
required: true,
},
Part_value: {
required: true,
},
JOB_Number: { // "required",simple rule, converted to {required:true}
required: true,
minlength: 9,
maxlength: 9
}
}
});
});
These two:
Part_code: {
required: true,
},
Part_value: {
required: true,
},
Should be:
Part_code: {
required: true
},
Part_value: {
required: true
},
You're right to think the ,
issue, a trailing comma in a property list is what'll break IE but usually squeak by in other browsers.
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