Welcome Guest, Not a member yet? Register   Sign In
need example form repopulation with session data
#1

[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)


Messages In This Thread
need example form repopulation with session data - by El Forum - 02-04-2009, 08:09 AM
need example form repopulation with session data - by El Forum - 02-04-2009, 12:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB