Welcome Guest, Not a member yet? Register   Sign In
How to redirect on form validation succes?
#3

[eluser]123wesweat[/eluser]
hmm, tx but that didn't work.

in welcome.php i added
Code:
function success(){
        $this->load->helper('url');
        $this->load->view('success');
    }//.end success

so now i am testing with
Code:
function process() {
        $this->load->helper('jsonwrapper');//http://www.boutell.com/scripts/jsonwrapper.html
        $this->load->helper('url');
        $this->load->library("validation");

        $fields['fname'] = 'Fname';
        $fields['lname'] = 'Lname';
        $this->validation->set_fields($fields);

        $rules['fname'] = 'trim|required';
        $rules['lname'] = 'trim|required';
        $this->validation->set_rules($rules);

        $this->validation->set_message('required', '%s  is required');


        if ($this->validation->run() == FALSE) {
            $data = array(
                    'fname' => $this->validation->fname_error,
                    'lname' => $this->validation->lname_error
            );
          
            echo json_encode($data);
        } else {
           $data = array(
                    'fname' => $this->input->post("fname"),
                    'lname' => $this->input->post("lname")
            );
            //put in our DB
            //print_r($data);
           // echo 'save data';
           redirect('welcome/success', 'location');

        }
    }
but still i don't see success.


Messages In This Thread
How to redirect on form validation succes? - by El Forum - 01-09-2010, 12:21 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 12:57 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:10 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:14 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 01:22 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 04:31 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 07:59 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 08:29 PM
How to redirect on form validation succes? - by El Forum - 01-09-2010, 08:32 PM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 02:55 AM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 01:24 PM
How to redirect on form validation succes? - by El Forum - 01-10-2010, 03:04 PM
How to redirect on form validation succes? - by El Forum - 01-11-2010, 05:37 AM
How to redirect on form validation succes? - by El Forum - 01-11-2010, 12:00 PM



Theme © iAndrew 2016 - Forum software by © MyBB