开发者

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.. 开发者_JAVA百科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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜