You are here

function captcha_after_form_after_build in CAPTCHA After 7

Same name and namespace in other branches
  1. 6 captcha_after.module \captcha_after_form_after_build()

After build state of form. Decide should we skip captcha element validation.

1 string reference to 'captcha_after_form_after_build'
captcha_after_form_alter in ./captcha_after.module
Implementation of hook_form_alter().

File

./captcha_after.module, line 58
Show CAPTCHA protection on selected forms after specified number of unsuccessful form submit attempts has been made.

Code

function captcha_after_form_after_build($form_element, &$form_state) {

  // Test should we skip captcha widget validation.
  if (!captcha_after_show_captcha($form_element['form_id']['#value']) && ($captcha =& captcha_after_get_captcha_element($form_element))) {
    $captcha['#validated'] = TRUE;
    $captcha['captcha_widgets']['captcha_response']['#validated'] = TRUE;
  }
  return $form_element;
}