Suppose I have something like this:
<input type="text" class="..." placeholder="Title" name="box[0][title]" value="">
<input type="text" class="..." placeholder="Description" name="box[0][descrip]" value="">
If a second 'box' was added it would be:
<input type="text" class="..." placeholder="Title" name="box[1][title]" value="">
<input type="text" class="..." placeholder="Description" name="box[1][descrip]" value="">
How can I add validation if more boxes are added?
jQuery('form').validate({
rules: {
'box[0][title]': {
required: true
},
'box[0][descrip]': {
required: true
},
//How can I add rules if a second box is added?