开发者

Why isn't this form validating with jquery?

I have a form which is not working. I have simplified it greatly and thrown into a JSBIN :

http://jsbin.com/ifezas/edit#j开发者_JAVA技巧avascript,html

Even in this simple example, nothing validates. What gives?


You haven't specified any rules for how it should validate.

For example, you can add the class required to your inputs to make them required, or you can specify the rules like this:

$('#yourForm').validate({ 
    rules: { field1: 'required', field3: 'required' } 
});

See this for the list of built-in validation methods.


If you are looking to require the inputs.

Add a class of required to them. class='required'.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜