Welcome Guest, Not a member yet? Register   Sign In
If form validation fails
#1

[eluser]Patrick Reck[/eluser]
Hello!

I want to redirect people to a certain page if the form validations fails. However, I can't quite figure out how.

If i redirect people at the REDIRECT HERE comment below, it also redirects when it loads up the form and causes a endless loop.

Code:
public function create() {
        
        $this->form_validation->set_rules('email_adress', 'E-mail', 'required|valid_email|is_unique[users.email_adress]');

        if ($this->form_validation->run() !== FALSE) {
             // PASSED
        } else {
            // REDIRECT HERE
        }
        
        $this->load->view('user_register_view');
    }

How can I achieve this?


Messages In This Thread
If form validation fails - by El Forum - 01-11-2013, 06:01 AM
If form validation fails - by El Forum - 01-11-2013, 06:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB