• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ReCaptach error message as validation message

#1
[eluser]Adam_R[/eluser]
My controller for validation looks like

Code:
public function process()
{

  $this->load->library('form_validation');

  // Validate reCAPTCHA
  $this->recaptcha->recaptcha_check_answer($_SERVER['REMOTE_ADDR'],$this->input->post('recaptcha_challenge_field'),$this->input->post('recaptcha_response_field'));  

  if ($this->form_validation->run('form_validation') == TRUE && $this->recaptcha->is_valid) {

   echo 'Great Scucess!';
  }

  else {

   if (!$this->recaptcha->is_valid) {

    $this->form_validation->set_message('process', 'Your answer for the security question was incorrect, please try again.');
   }

   $this->display();  
  }
}

But when reCaptcha failed I'm not getting displayed added error message.

Any clue?

Thanks

#2
[eluser]Adam_R[/eluser]
OK, I have got resolved that issue used callback function Smile


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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