views:

68

answers:

1

I use a JQuery Validation script for Validating HTML Form. this is perfectly work with Firefox but not work in IE8. I think there is issue with colon(;) or semi-colon(,)...but I am unable to catch.

please someone help me. code is here.

<script type="text/javascript"> 
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
}
}
 });
 });

Thanks in Advanced

+1  A: 

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.

Nick Craver
thanks Nick Craver
thanks Nick Craver
@user437641 - welcome :) be sure to accept answers on this and your other questions to close them out :)
Nick Craver