Problem getting set_value() to repopulate a form |
[eluser]Unknown[/eluser]
I am using arrays as field names, but am having trouble getting set_value() to repopulate the data. Here is my view Code: <?=form_open('contacts/index');?> On validation fail, it fills in the email addresses as 'Array'. Any help on this?
[eluser]sketchynix[/eluser]
What do your controller & model functions look like that are feeding the email addresses in? It looks like it is most likely wrapped in an extra array ie. instead of Code: array('email'=>array()); it is Code: array('email'=>array(array())); You could also do a var_dump() of $email in the view to see the structure.
[eluser]Unknown[/eluser]
The controller isn't feeding in any values - these values are based on the form being filled out. So if someone fills out the form and validation fails, they should be brought back to the form with the fields pre-popped with what the filled out on the previous version (rather than having to retype everything).
[eluser]sketchynix[/eluser]
I tested this out pretty thoroughly and got the same result as you. It appears to be a bug.. I'd check out these threads and see if you can implement on of those solutions ellislab.com/forums/viewthread/167262/ ellislab.com/forums/viewthread/156497/ |
Welcome Guest, Not a member yet? Register Sign In |