Home >Web Front-end >JS Tutorial >jQuery Validate verification, a specific example of verification rules written in the control_jquery

jQuery Validate verification, a specific example of verification rules written in the control_jquery

WBOY
WBOYOriginal
2016-05-16 16:58:041095browse

将校验规则写到控件中

复制代码 代码如下:



$().ready(function() {
 $("#signupForm").validate();
});


   


       
       
   


 


 
 
 


 


 
 
 


 


 
 
 


   


       
   




Tips:
使用class="{}"的方式,必须引入包:jquery.metadata.js

可以使用如下的方法,修改提示内容:
class="{required:true,minlength:5,messages:{required:'请输入内容'}}"

在使用equalTo关键字时,后面的内容必须加上引号,如下代码:
class="{required:true,minlength:5,equalTo:'#password'}"

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn