recaptchaPublicKey, $error, $useSSL); $form->assign('recaptchaHTML', $html); $form->assign('recaptchaOptions', $config->recaptchaOptions); $form->add( 'text', 'g-recaptcha-response', 'reCaptcha', NULL, TRUE ); $form->registerRule('recaptcha', 'callback', 'validate', 'CRM_Utils_ReCAPTCHA'); if ($form->isSubmitted() && empty($form->_submitValues['g-recaptcha-response'])) { $form->setElementError( 'g-recaptcha-response', ts('Input text must match the phrase in the image. Please review the image and re-enter matching text.') ); } } }