开发者

Validate input array form with jquery.validate.min.js

How can i validate x inputs with name array like init_d开发者_运维知识库ate[] with this plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/?

$('#form').validate({
    rules: {
        year:{required:true,number:true},
        type:{required:true},
        init_date:{required:true,date:true}
    }
});

Thanks a lot


The documentation covers this.

Here's how to do it.


You should write a custom validation using Validator.addMethod(), I think it's not possible to apply validation based on names, you can validate a group of input elements using classes but not names.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜