CodeIgniter Forums
ReCaptach error message as validation message - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: ReCaptach error message as validation message (/showthread.php?tid=55311)



ReCaptach error message as validation message - El Forum - 10-19-2012

[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


ReCaptach error message as validation message - El Forum - 10-19-2012

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