In Drupal 7, I use the Commerce_Checkout_Redirect module which uses custom validation functions. It uses the following code.
// Use the username as order email.
// Email validation for the username form element
if (variable_get('commerce_checkout_redirect_username_as_order_email', FALSE)) {
$form['name']['#title'] = t('Email');
$form['actions']['continue_button']['#limit_validation_errors'] = array(array('name'));
$form['actions']['continue_button']['#validate'][] = 'commerce_checkout_redirect_username_as_order_email_form_validate';
}
The validation function is the following.
function commerce_checkout_redirect_username_as_order_email_form_validate($form, &$form_state) {...}
The form ID is user_login, the reCaptcha is enabled for this form and it is shown, but it is ignored by the validation process when users submit the form.
How can I "force" the validation of the reCaptcha inside a custom validation function?