Dynamically add form fields
Whats the easiest way to be able to create form fields dynamically? Lets say i have the following code:
<cfform name="test" action="submit.cfm" method="post">
<table>
<tr>
<td>Name</td>
<td>Quantity</td>
</tr>
<tr>
<td><cfinput type="text" name="name1"></td>
<td><cfinput type="text" name="quant1"></td>
</tr>
<tr>
<td><cfinput type="text" name="name2"></td>
<td><cfinput type="text" name="quant2"></td>
</tr>
<tr>
<td><cfinput type="button" name="addField" value="Add Item"></td>
</tr>
<tr>
<td><cfinput type="submit" name"submitForm" value="Submit"></td>
</tr>
</table>
</cfform>
How would i be ableto use the addField button to add more input fields?
