Web前端校验之jquery.validate(三)
作为jquery校验的补充,再进行整理
除了之前说的在ready中加入校验外,还可以在html中的class中直接加入校验,如下
补充一:
<form id="testForm" name="testForm"><input id="password" name="password" type="password" name="confirm_password" type="password" equalTo="#password"/><input id="email" name="email" name="code"><script> $(document).ready(function(){ $("#testForm").validate(); }</script><style type="text/css">#testForm label.error {padding-left: 16px;margin-left: 2px;color:red;background: url(img/unchecked.gif) no-repeat 0px 0px;}</style>$(document).ready(function(){$("#testForm").validate({ event:"keyup" || "blur" })})$(document).ready(function(){$("#testForm").validate({ debug:true })})