[eluser]moonbeetle[/eluser]
(form validation library CI 1.7.0)
Hi, I want to repopulate a form, using the Form Validation library, with session data (if the data exists). I was thinking about something like this:
Code:
if ($this->form_validation->run() == FALSE)
{
//Not OK OR validation hasn't run yet
// Check for session data
if($this->session->userdata("myform_data"))
{
// Repopulate form with session data
}
else
{
// Blank form - initial state
$data = array();
}
}
else
{
// OK - Do stuff with validated input data
}
Is there a method I can use to repopulate from fields?
Something like:
Code:
$this->form_validation->fieldname = "some value";
or
$this->form_validation->set_value('fieldname','some value');
(both don't work)