I am a new to codeIgniter and I just got stuck in the very beginning. I am using HMVC extention and while validating I am getting the following error:
Unable to access an error message corresponding to your field name Password.(pword_check)
any help would be greatly appreciated
Code:
public function submit()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|max_length[30]|xss_clean');
$this->form_validation->set_rules('pword', 'Password', 'required|max_length[30]|callback_pword_check|xss_clean');
if ($this->form_validation->run() == FALSE)
{
$this->login();
}
else
{
echo 'Success'; die();
}
}
public function pword_check($str)
{
if ($str == 'test')
{
$this->form_validation->set_message('pword_check', 'The %s field can not be the word "test"');
return FALSE;
}
else
{
return TRUE;
}
}