I have a form which can have up to 6 children added to it. Therefore there will be 6 sets of the following HTML:
<table class="portletTable child" cellpadding="0" cellspacing="0" border="0" summary="Please enter some more details regarding your dependants">
<tr>
<th>
<label for="indTitle">Title</label>
</th>
<td colspan="3">
<select id="indTitle" class="inlineSpace">
<option value="Please select">Please select...</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Ms">Ms</option>
<option value="Miss">Miss</option>
<option value="Dr">Dr</option>
<option value="Other">Other</option>
</select>
<label for="indOther" class="inlineSpace">Other</label>
<input type="text" class="text" name="indOther" id="indOther" maxlength="20" />
</td>
</tr>
<tr>
<th>
<label for="firstname">First name</label>
</th>
<td colspan="3">
<input type="text" class="text" maxlength="50" value="" id="firstname" />
</td>
</tr>
<tr>
<th>
<label for="lastname">Last name</label>
</th>
<td colspan="3">
<input type="text" class="text" maxlength="50" value="" id="lastname" />
</td>
</tr>
<tr>
<th>
<label for="dobDay">Date of birth</label>
</th>
<td colspan="3">
<select name="dobDay" id="dobDay" class="inlineSpace">
<option value="day">Day</option>
</select>
<label for="dobMonth" class="offScreen">Month</label>
<select name="dobMonth" id="dobMonth" class="inlineSpace">
<option value="month">Month</option>
</select>
<label for="dobYear" class="offScreen">Month</label>
<select name="dobYear" id="dobYear">
<option value="year">Year</option>
</select>
<p class="fieldNote">You must be over 'minimum partner age' and under 'max partner age'</p>
</td>
</tr>
<tr>
<th>
Gender
</th>
<td colspan="3">
<input id="male" name="childGender" class="radio" type="radio" />
<label for="male" class="inlineSpace">Male</label>
<input id="female" name="childGender" class="radio" type="radio" />
<label for="female">Female</label>
</td>
</tr>
</table>
I need the first child to show by default and the following five to be hidden from view.
When a user clicks the following link i want the second child to show, if they click it again then the third child inputs show and so on...
<tr>
<th class="dependant">
<a href="" class="add">Add another child to your policy</a>
</th>
</tr>
Obviously when the sixth child is shown the link should not display.
I also need the reverse to be true in that a user has the option to remove the latest added child with this hyperlink:
<tr>
<th class="dependant">
<a href="" class="remove">Remove this child from your policy</a>
</th>
</tr>
If Javascript is turned off then all will show by default.
Thanks in advance if any of you can help.