Blogger Information
Blog 175
fans 1
comment 0
visits 384820
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
jQuery validate 的valid()方法一直返回true
dxp2tq的博客
Original
2453 people have browsed it

jQuery validate 的valid()方法一直返回true

1 调用$('#myForm').valid(),一直返回ture

eg:html

<form id="myForm"><input class="form-control" required type="text"></input><textarea class="form-control" row="3" required minlength="1"></textarea></form>

eg:js

$('#myForm').validate();$('#myForm').valid()//此处一直返回true,无论表单有没有填写

原因

jQuery validate的每个验证的字段必须要有name属性,并且要有值,不然验证会一直返回true。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post