07-06-2009, 07:50 AM
[eluser]patrickpopowicz[/eluser]
Have you tried passing the sig_key through the callback instead of using it from the input post (see below)? Is your callback in your controller and do you get the same error when you remove the callback function from the validation?
Have you tried passing the sig_key through the callback instead of using it from the input post (see below)? Is your callback in your controller and do you get the same error when you remove the callback function from the validation?
Code:
$this->form_validation->set_rules('sig_key', 'lang:sig_key', 'trim|xss_clean|required|callback_checkSigKey');
function checkSigKey($sig_key)
{
if ($sig_key !== $this->session->userdata('sig_key'))
{
$this->form_validation->set_message('checkSigKey', $this->lang->line('sig_key_invalid'));
return false;
}
else
{
return true;
}
}