CodeIgniter Forums

Full Version: Call back not working
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]behnampmdg3[/eluser]
Code:
$this->form_validation->set_rules('original_value', 'Original Value', 'required|callback_validate_original_value');
Code:
public function validate_original_value($original_value)
  {
   if(!is_numeric($original_value) )
   {
    $this->form_validation->set_message('validate_original_value', 'Please insert ONLY numbers from original value.');
    if (strpos($original_value,'$') !== false)
    {
     $this->form_validation->set_message('validate_original_value', 'Please remove the dollar sign from original value.');
    }
    return false;
   }
   else
   {
    return true;
   }
  }

El Forum

[eluser]Ckirk[/eluser]
In what way is it not working? Is it not calling the callback function at all?
If that's the case make sure your callback is in the controller (not the model)