11-26-2010, 03:10 PM
[eluser]dynZack[/eluser]
For some reason a validation callback is never called. Here's the code:
I'm banging my head against the wall for the last 3+ hours and I'm having thoughts of cutting my dick off. :ahhh:
Can anyone spot what might be the problem?
Edit: Corrected the name of the callback function
For some reason a validation callback is never called. Here's the code:
Code:
function process_form(){
//check if categories are set
$this->form_validation->set_rules('categoryParent', 'categoryParent', 'required|callback_notdefault');
if ($this->form_validation->run() == FALSE){//validate
echo validation_errors();
return;
}
}
Code:
function notdefault($str){
// die($str) <-- never reached
if( ($str === '0') ){
$this->form_validation->set_message('not_default',
$this->lang->line('choose_category_subcategory'));
return FALSE;
}
else {
return TRUE;
}
}
I'm banging my head against the wall for the last 3+ hours and I'm having thoughts of cutting my dick off. :ahhh:
Can anyone spot what might be the problem?
Edit: Corrected the name of the callback function