Problems with extending CI_Form_validation |
Problem 1:
PHP Code: $this->form_validation->set_rules('email', '', 'scanEmail|required'); You have set two rules, but if you post an empty form then Rule 1, scanEmail, will return TRUE Rule 2, required, will return FALSE And that causes $this->form_validation->run() to return FALSE Don't only var_dump() the run method. Place a var_dump() in each rule method that should run and var_dump the passed in arguments. That way you can see if it even reaches a rule or not. Problem 2: You should set the messages when setting the rules. I think because you are doing it only when the rule fails it can't find the message. PHP Code: $this->form_validation->set_rules('email', 'Field Label', 'scanEmail|required', |
Welcome Guest, Not a member yet? Register Sign In |