![]() |
Repopulating a form from session data - 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: Repopulating a form from session data (/showthread.php?tid=24072) |
Repopulating a form from session data - El Forum - 10-29-2009 [eluser]Jesse Schutt[/eluser] Hi guys, I know that this is a fairly simple question, but I don't know the syntax to accomplish it! Code: <label for="first_name">First Name <span class="required">*</span></label> What I'd like to do is have the form check if the 'first_name' is set in the user's session. If it is set, then I'd like it to be in the set_value. If it is not set, I'd like it to be blank (unless it is being validated...) Thanks Much!! Jesse Repopulating a form from session data - El Forum - 10-29-2009 [eluser]Ben Edmunds[/eluser] Do you not want to use the validation class? Repopulating a form from session data - El Forum - 10-29-2009 [eluser]Jesse Schutt[/eluser] Ben, Yes, I'm using the validation. I actually just figured out how to do it using Code: <?php echo set_value('first_name', $this->session->userdata('first_name'); ?> Thanks! Repopulating a form from session data - El Forum - 10-29-2009 [eluser]skunkbad[/eluser] set_value() comes from the form validation, so : Code: <?php |