CodeIgniter Forums
set_value() not handling arrays for form field names properly - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: set_value() not handling arrays for form field names properly (/showthread.php?tid=17017)



set_value() not handling arrays for form field names properly - El Forum - 03-23-2009

[eluser]Kenzie[/eluser]
When using an array for a form field name, redisplaying the value with set_value when there's a validation error results in a string of "Array" instead of the actual submitted value.

Code:
$this->form_validation->set_rules('options[]', 'Options', 'required');
<input type="text" name="options[]" value="<?php echo set_value('options[]'); ?>" size="50" />

Tested with CI 1.7.1, PHP 5.2.6


set_value() not handling arrays for form field names properly - El Forum - 03-27-2009

[eluser]The Wizard[/eluser]
try a workarround with form helper and generating them with the selected parameter using set_select.


set_value() not handling arrays for form field names properly - El Forum - 04-06-2009

[eluser]Unknown[/eluser]
I'm having the same issue...could you elaborate?


set_value() not handling arrays for form field names properly - El Forum - 04-07-2009

[eluser]The Wizard[/eluser]
Hello
i dont have the time these days so please look at my last posts, i explained something similar there.
take care