• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.