quadrant6
01-23-2006, 02:35 AM
I have the following structure
<div id="rows">
<div id="row-0" class="row">
<input name="firstname[]" class="firstname" type="text" />
<input name="lastname[]" type="text" class="lastname" />
<input name="email[]" type="text" class="email" />
</div>
<div id="row-1" class="row">
<input name="firstname[]" class="firstname" type="text" />
<input name="lastname[]" type="text" class="lastname" />
<input name="email[]" type="text" class="email" />
</div>
and so on... the number of these div rows is dynamic
</div>
What I'd like to do is loop through each div row ("row-0", "row-1"..) and check that both the firstname and lastname fields have been filled in. If not, then I would like to display a generic message and place the cursor in the blank field.
Does anyone have any suggestions on how to use this?
<div id="rows">
<div id="row-0" class="row">
<input name="firstname[]" class="firstname" type="text" />
<input name="lastname[]" type="text" class="lastname" />
<input name="email[]" type="text" class="email" />
</div>
<div id="row-1" class="row">
<input name="firstname[]" class="firstname" type="text" />
<input name="lastname[]" type="text" class="lastname" />
<input name="email[]" type="text" class="email" />
</div>
and so on... the number of these div rows is dynamic
</div>
What I'd like to do is loop through each div row ("row-0", "row-1"..) and check that both the firstname and lastname fields have been filled in. If not, then I would like to display a generic message and place the cursor in the blank field.
Does anyone have any suggestions on how to use this?