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
Release: 2016-05-16 16:58:04
Original
1102 people have browsed it

将校验规则写到控件中

复制代码 代码如下:



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


   


       
       
   


 


 
 
 


 


 
 
 


 


 
 
 


   


       
   




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

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

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template