I have more that one text boxes with same name and class. I use jQuery validate to validate it as required. Issue here is when I submit the form without entering values for fields other than 1st check box, error messages are showing next to first textbox. For example if I submit form without entering values for 2nd textbox, it will show error message near to first text box. I think it is because of using same name/class for validation.
I have tried using class and name. No change. My sample code is given below. Any thoughts?
HTML part
<input type="text" class="unit_price" name="add_purch_unit[]">
<input type="text" class="unit_price" name="add_purch_unit[]">
jQuery Part
$(".unit_price").rules("add", {
required:true
});