Some forms have links on them where you click them and they add sections to the form. I'd like to do something similar with my form.
I'd like for someone to be able to click on the "Add name" link and have it at a row of the same information, however, there can only be a maximum of 9 rows including.
For each row that's created, it needs to have a "Remove name" link to the right, as shown in the code below, that will remove that column.
Once 9 rows are reached the "Add name" link needs to go away, and just have only the "Remove name" link. The Remove name link should only appear on the very last row.
Each row needs to also have it's own unique field IDs. (i.e. last1, last2, last3, etc)
Here's some HTML I threw together just to give you an idea...
<form id="nameForm" name="form1" method="post" action=""><table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="23%"> Last Name<br>
<input name="last1" type="text" id="last1">
<br>
</td>
<td width="24%">First Name<br>
<input name="first3" type="text" id="first3">
</td>
<td width="26%">Phone Number<br>
<input name="phone1" type="text" id="phone1">
</td>
<td width="27%"> </td>
</tr>
<tr>
<td> Last Name<br>
<input name="last2" type="text" id="last2">
<br>
</td>
<td>First Name<br>
<input name="first2" type="text" id="first2">
</td>
<td>Phone Number<br>
<input name="phone3" type="text" id="phone3">
</td>
<td valign="bottom"><a href="#">Remove name</a></td>
</tr>
<tr>
<td><a href="#">Add name</a></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>
I'd like for someone to be able to click on the "Add name" link and have it at a row of the same information, however, there can only be a maximum of 9 rows including.
For each row that's created, it needs to have a "Remove name" link to the right, as shown in the code below, that will remove that column.
Once 9 rows are reached the "Add name" link needs to go away, and just have only the "Remove name" link. The Remove name link should only appear on the very last row.
Each row needs to also have it's own unique field IDs. (i.e. last1, last2, last3, etc)
Here's some HTML I threw together just to give you an idea...
<form id="nameForm" name="form1" method="post" action=""><table width="100%" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="23%"> Last Name<br>
<input name="last1" type="text" id="last1">
<br>
</td>
<td width="24%">First Name<br>
<input name="first3" type="text" id="first3">
</td>
<td width="26%">Phone Number<br>
<input name="phone1" type="text" id="phone1">
</td>
<td width="27%"> </td>
</tr>
<tr>
<td> Last Name<br>
<input name="last2" type="text" id="last2">
<br>
</td>
<td>First Name<br>
<input name="first2" type="text" id="first2">
</td>
<td>Phone Number<br>
<input name="phone3" type="text" id="phone3">
</td>
<td valign="bottom"><a href="#">Remove name</a></td>
</tr>
<tr>
<td><a href="#">Add name</a></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
</form>