Hi i am developing a multi page form in which you have to enter the number of people in the first step and then in the next step you enter the information for the same number of people. Now i am posting the data to step 2 and fetching the data via sessions.i am using this code inside form body .
<?php
$i=0;
for($i=1;$i<=$_POST['number'];$i++)
echo $message='
<div class="section colm colm4">
<label for="firstname" class="field prepend-icon">
<input type="text" name="firstname['.$i.']" id="firstname" class="gui-input" placeholder="First Name">
</div>
';
?>
and this is working fine.But the problem is when i am trying to validate the form using jquery its not validating. EDIT : okay now i know that in validation each and every rule name should be unique.but how to do that ? As i do not know the number of fields
'firstname[1]': {
required: true,
minlength: 2
},
'firstname[2]': {
required: true,
minlength: 2
},
'firstname[3]': {
required: true,
minlength: 2
},
this is a sample rule for three fields how can i set up a loop in there for 10 fields ?