• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Validation callback not called...

#1
[eluser]dynZack[/eluser]
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


Messages In This Thread
Validation callback not called... - by El Forum - 11-26-2010, 03:10 PM
Validation callback not called... - by El Forum - 11-26-2010, 03:13 PM
Validation callback not called... - by El Forum - 11-27-2010, 01:21 AM
Validation callback not called... - by El Forum - 11-27-2010, 01:36 AM
Validation callback not called... - by El Forum - 11-27-2010, 02:19 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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