CodeIgniter Forums
Repopulate form using set_value(?) while not using form_validator - 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: Repopulate form using set_value(?) while not using form_validator (/showthread.php?tid=30220)



Repopulate form using set_value(?) while not using form_validator - El Forum - 05-06-2010

[eluser]Unknown[/eluser]
Hi

My application flow is like this:
A form -> Validator (Form_Validator which makes me choose to use set_value() in the form for repopulating) -> A control page where the user can see if he/she finally has put in correct values.

If the person wants to change something, the user is directed to the form again along with post data. I therefore do somethink like $this->load->view('myform', $_POST), but since I already use set_value() (and not variable-names which corresponds to the POST-keys) my form don't get repopulated.

Well, I hope you understood my little problem.

Has someone got a solution?


Repopulate form using set_value(?) while not using form_validator - El Forum - 05-06-2010

[eluser]steelaz[/eluser]
set_value() is actually part of Form Helper (http://ellislab.com/codeigniter/user-guide/helpers/form_helper.html), you can load it like this:

Code:
$this->load->helper('form');

and if data is still in $_POST array, set_value() should work for you.