开发者

jQuery.validate() validating even if nothing entered

开发者 https://www.devze.com 2023-03-11 00:54 出处:网络
I\'m working with the validate() method in jQuery. According to the docs: If nothing is entered, all rules are

I'm working with the validate() method in jQuery. According to the docs:

If nothing is entered, all rules are skipped, except when the field was already marked as invalid.

and following is my code:

$("#Form").validate(
{
      errorClass: "dialogerror",
      onfocusout:          function(element)
                         {
                             $(element).valid();
                         },
      onkeyup: false
}); 

However it produces the error message even if nothing is entered, so my guess is 开发者_如何学运维the element is being marked as invalid when loaded, could this be true? Perhaps an option is set somewhere and I'm looking in the wrong place.

Any advice much appreciated.

0

精彩评论

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