Hi all,
So I have a question which I haven’t found an answer to. I know that when collecting tabular input you need to add [$i] to your fields (in my case ‘[$i]distance’) and that $i needs to be an index from 0 to x depending on the number of elements on the form.
I’m jusing JQuery to clone a div which contains my “many” inputs whoever I’m not sure how to dynamically update $i for each row of inputs.
Really Simple jquery:
function addSet()
{
$("#set:last").clone().appendTo("#set_wrapper");
}
Example of input row:
<td style="vertical-align:top">
<?php echo $form->labelEx($set,'[0]distance'); ?>
<?php echo $form->textField($set,'[0]distance',array('size'=>4,'maxlength'=>4)); ?>
<?php echo $form->error($set,'[0]distance'); ?>
</td>
If I add rows manually and manually adjust $i the form works fine, I’m just running into a wall setting $i dynamically when adding inputs with JQuery.
I’d really like to keep the page dynamic so that I’m not forcing people to use a static number of inputs.
Anybody have any suggestions?
**Sorry for double post, forum threw an error at me