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.
精彩评论