[eluser]TunaMaxx[/eluser]
I'm having a hard time wrapping my brain around using the form validation class when field names may not be known ahead of time.
For example, I have a form that accepts order details. The user can click and "Add an Item" button and another row of details is added to the form by javascript. The initial form is something like this:
Code:
<form>
<div id="order_01">
<input type="text" name="name_01" value="" id="name_01">
<input type="text" name="size_01" value="" id="size_01">
<input type="text" name="color_01" value="" id="color_01">
</div>
<input type="submit" value="Add an Item">
</form>
Clicking the "Add an Item" button generates something like this:
Code:
<form>
<div id="order_01">
<input type="text" name="name_01" value="" id="name_01">
<input type="text" name="size_01" value="" id="size_01">
<input type="text" name="color_01" value="" id="color_01">
</div>
<div id="order_02">
<input type="text" name="name_02" value="" id="name_02">
<input type="text" name="size_02" value="" id="size_02">
<input type="text" name="color_02" value="" id="color_02">
</div>
<input type="submit" value="Add an Item">
</form>
I know you can use arrays as field names, but I'm not sure that applies here. Any suggestions?