Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Validate causing error in IE 7 & 8

Using jQuery 1.5.2 getting javascript error:

Error: '$.validator.methods[...]' is null or not an object

I have tested it in IE7 and IE8 and got the error. The validation works fine in Firefox 4 and earlier.

When tabbing from the address1 field to address2 field.. in fact when clicking from address1 with info in it to addres2 with no info. Also... weird when tabbing or clicking from the Zip field to the county field I get no error with info in or out of zip and/or county... also, the zip field has a maskedinput validation on it county does not. I was using jQuery 1.4.2 and saw this response to a similar question (Jquery Validator not working in IE 7 or 8). I was using jQuery 1.4.2 and upped to 1.5.2 with the same results.

Here is my validate code.

$('#frm_subefoLocation').validate({
  rules: {
    address1: { require:true,maxlength:100,minlength:2},
    address2: { require:false,maxlength:100},
    city: { require:true,maxlength:100,minlength:2},
    zip: { required:true,minlength:5,maxlength:10,number:true},
    county: { require:false,maxlength:100,minlength:0},
    mailAddress1: { require:true,maxlength:100,minlength:2},
    mailAddress2: { require:false,maxlength:100,minlength:0},
    mailCity: { require:true,maxlength:100,minlength:2},
    mailZip: { required:true,minlength:5,maxlength:10,number:true}
  }
});

Here is the masked input code:

// set up mask for entry
$('#zip').mask('99999');

Any ideas?

like image 824
Chris Avatar asked Dec 06 '25 04:12

Chris


1 Answers

Looking at the code this morning I noticed... 'require' is not allowed... 'required' is required.. The difference didn't bother Firefox but sure did mess with IE.

like image 145
Chris Avatar answered Dec 07 '25 18:12

Chris



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!