[eluser]vertmonkee[/eluser]
I have a form where users will be able to enter animals they have seen. They enter the amount they have seen and I then use javascript to create the input boxes.
E.g. if the user enters 3 it will output
Code:
<input type="text/javascript" name="animalName[]" />
<br />
<input type="text/javascript" name="animalName[]" />
<br />
<input type="text/javascript" name="animalName[]" />
I am struggling with how to repopulate the fields if the form has errors.
Currently I set up my input properties as an array like so
Code:
$animal_name = array(
'name' => 'animalName',
'id' => 'animalName',
'value' => set_value('animalName'));
Then create the input like this
Code:
<?php echo form_input($animal_name); ?>
Has anyone done something similar to this before and how did you solve it?
Thanks for any help