I need to validate an array of input text elements (mileage): For example:
<tbody>
<c:forEach items="${list}" var="item">
<tr>
<!--some other columns--->
<td align="left"><input type="text" name="mileage" value="" /></td>
</tr>
</c:forEach>
</tbody>
The script for validation is as below -
$(document).ready(function(){
$("#form1").validate({
rules: {
mileage: {
required: true
}
},
submitHandler: function(form) {
form.submit();
}
});
});
Now the problem is that the .validate.js only validates the first element of mileage. What can I do? How can I make the plugin validate all of the inputs text ?
I hope you can help me out.