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.
精彩评论