1 Required and Remote check
$ ("#inputForm"). Validate ({rules: {"username": "Required", "loginID": {remote: {type: "post", url: "${ctx}/user/ Isunicode.do ", data: {code:function () {return $ (" #loginid "). Val ();}},datatype:" html ", datafilter:function (data, type {if (data = = "1") return True;elsereturn false;}}}},messages: {username: "Please fill in the name", loginID: {remote: "The role number already exists"}});
2 Password verification
$ ("#inputForm"). Validate ({<span style= "White-space:pre" ></span>rules: {<span style= "White-space: Pre "></span>pwd:{ <span style=" White-space:pre "></span>required:true,<span style=" White-space:pre "></span>minlength:6 //self-judging character minimum length <span style=" White-space:pre "></span> }, <span style= "White-space:pre" ></span>pwdrepeat: { <span style= "White-space:pre" > </span> required:true,<span style= "White-space:pre" ></span> minlength:6,<span style= " White-space:pre "></span> equalto:" #pwd "<span style=" White-space:pre "></span>}<span style= "White-space:pre" ></span>},<span style= "White-space:pre" ></span>messages: {<span style= " White-space:pre "></span> <span style=" White-space:pre "></span>< Span style= "White-space:pre" ></span>pwd:{ <span style= "White-space:pre" ></span>required: ' Please enter password ', <span style= "White-space:pre" ></span>minlength: "Confirm password cannot be less than 6 characters" <span Style= "White-space:pre" ></SPAN>}, <span style= "White-space:pre" ></span>pwdrepeat: { <span style= "White-space:pre" ></span>required: "Please enter confirmation password", <span style= "White-space:pre" ></span>minlength: "Confirm password cannot be less than 6 characters", <span style= "White-space:pre" ></span>equalto: " Two times input password inconsistent " <span style=" White-space:pre "></span> } <span style=" White-space:pre " ></span>}});
Jquery Validate Validation