[eluser]20000RPM[/eluser]
Hi,
I've got a form which can have an arbitrary number of fields (in reality probably very few: less that 5).
The posted array might look like this:
Code:
expenses[0][name] => 'Travel',
expenses[0][amount] => '£5.00',
expenses[1][name] => 'Equipment',
expenses[1][amount] => '£15.00'
Now, how can I repopulate the form using set_value()? I already can validate the data using a callback like this:
Code:
array(
'field' => 'expenses[]',
'label' => 'Expenses',
'rules' => 'callback__is_expense'
)
And that callback can return the array properly. But it's not repopulating the form. I'm doing this:
Code:
set_value('expenses[0][amount]');
I could take a different approach if that's the way to go.