Welcome Guest, Not a member yet? Register   Sign In
Form_validation isn't using rules from config file (CI2)
#5

[eluser]kirkaracha[/eluser]
Where it's redirecting isn't the problem. The problem is I submit the add form without a required field and it isn't being caught by the validation. The same validation rules work if I include them in my controller.
Code:
// added to save function above:
$config = $this->_add_edit_person_form();
$this->form_validation->set_rules($config);

private function _add_edit_person_form(){
    $config = array(
        array(
        'field' => 'first_name',
        'label' => 'first name',
        'rules' => 'trim|required'
        )
    );
    return $config;
} // _add_edit_person_form


Messages In This Thread
Form_validation isn't using rules from config file (CI2) - by El Forum - 01-18-2011, 09:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB