Welcome Guest, Not a member yet? Register   Sign In
Form validation shows only last error! pls help!
#2

[eluser]Irfan Cikoglu[/eluser]
You havent any validation rule on first_name and last_name, so this is problem. Use this controller Wink
Code:
public function index () {
        if (!$this->input->post()) {
            $this->load->view("install");
        }        
        $this->form_validation->set_rules("website", "website", "trim|required|xss_clean");
        $this->form_validation->set_rules("username", "username", "trim|required|alpha_numeric|xss_clean");
        $this->form_validation->set_rules("password", "password", "trim|min_length[5]|xss_clean");
        $this->form_validation->set_rules("email", "email", "trim|required|valid_email|xss_clean");
        $this->form_validation->set_rules("first_name", "first name", "trim|min_lenght[3]|xss_clean");
        $this->form_validation->set_rules("last_name", "last name", "trim|min_lenght[3]|xss_clean");
        
        if ($this->form_validation->run() === FALSE)
        {
            $this->load->view("install");
        }
        else
        {
            $this->load->view("install");
        }
    }
If you still have problem, then remove first_name and last_name rules and manually trim and clean XSS Wink


Messages In This Thread
Form validation shows only last error! pls help! - by El Forum - 07-08-2011, 09:21 AM
Form validation shows only last error! pls help! - by El Forum - 07-08-2011, 10:20 AM
Form validation shows only last error! pls help! - by El Forum - 07-08-2011, 12:28 PM
Form validation shows only last error! pls help! - by El Forum - 07-09-2011, 09:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB