Welcome Guest, Not a member yet? Register   Sign In
Call back not working
#1

[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;
   }
  }
#2

[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)




Theme © iAndrew 2016 - Forum software by © MyBB