[eluser]Corbee[/eluser]
Consider this scenario:
I'm using an ajax to make the form use only one page
I got a multistep form with step3 being the result of step2, within step3 there is an "add more steps" button which duplicates step2 and step3, this can be done countless times.
to complement this I added array to my input boxes something like this:
Code:
<input type="text" name="name[]" id="name"/>
unfortunately, I'm not sure how to approach this in the php.
In the step2 going to step3, I would call the brand id and use it in the database to get the results for step3,
but now it's array, so I added the following lines
Code:
$brand = $this->input->post('brand[]');
$this->load->model('MBest');
$q = $this->MBest->getbestmatching($brand[0]);
But the $brand[0] doesn't works and triggers an error.
And come to think of it, if I call a $brand[0] index, then everytime a person add a new step, it will always use the id of the first result.
Are there any ideas on how to fix this problem? Thanks