Welcome Guest, Not a member yet? Register   Sign In
Logic for multi-step form.. not working.
#1

[eluser]tomclowes[/eluser]
Ok my logic for a multi step form is as follow.

A session value which contains the stage.

- if no stage
- if form 1 not validated
- display stage 1
- if form 1 validated
- set session to step2

- if step 2
- if step 2 not validated
- show step 2
- if form 2 validated
- set session to complete

- if complete
- show thanks message

What is happening is as follows. I submit form 1 correctly, it loads the complete view.
So basically it is setting session to step 2, saying step 2 is validated, setting session to complete, and loading thankyou message. I.E The step 2 validation is not working.

This is the frame of the code:

Code:
if(!$this->session->userdata('form_stage'))
        {

            if ($this->form_validation->run('suggest_1') == FALSE)
            {


            }
            else
            {
                
                $this->session->set_userdata('form_stage', 'step_2');
                
            }
        }
        
        if($this->session->userdata('form_stage')=='step_2')
        {
            if ($this->form_validation->run('suggest_2') == FALSE)
            {

            }
            else
            {
                
                $this->session->set_userdata('form_stage', 'complete');
                
            }
        }
        
        if($this->session->userdata('form_stage')=='complete')
        {

        }


Any Ideas?

I've spent hours on this without success Sad

Thanks


Messages In This Thread
Logic for multi-step form.. not working. - by El Forum - 09-07-2010, 04:44 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 04:14 AM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 09:34 AM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 09:38 AM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 10:35 AM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 11:50 AM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 12:17 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 12:29 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 12:34 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 12:40 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 01:07 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 01:18 PM
Logic for multi-step form.. not working. - by El Forum - 09-08-2010, 01:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB