diff --git a/recaptcha.admin.inc b/recaptcha.admin.inc index bd2dc23..644baa9 100644 --- a/recaptcha.admin.inc +++ b/recaptcha.admin.inc @@ -73,6 +73,12 @@ function recaptcha_admin_settings() { '#default_value' => variable_get('recaptcha_tabindex', 0), '#size' => 4, ); + $form['recaptcha_widget_settings']['recaptcha_data_callback'] = array( + '#type' => 'textfield', + '#title' => t('Data-callback attribute'), + '#description' => t('The name of your callback function to be executed when the user submits a successful CAPTCHA response. The user\'s response, g-recaptcha-response, will be the input for your callback function.'), + '#default_value' => variable_get('recaptcha_data_callback', ''), + ); $form['recaptcha_widget_settings']['recaptcha_noscript'] = array( '#type' => 'checkbox', '#title' => t('Enable fallback for browsers with JavaScript disabled'), diff --git a/recaptcha.module b/recaptcha.module index 1e65aab..b32edcc 100644 --- a/recaptcha.module +++ b/recaptcha.module @@ -107,6 +107,7 @@ function recaptcha_captcha($op, $captcha_type = '') { 'data-type' => variable_get('recaptcha_type', 'image'), 'data-size' => variable_get('recaptcha_size', ''), 'data-tabindex' => variable_get('recaptcha_tabindex', 0), + 'data-callback' => variable_get('recaptcha_data_callback', ''), ); // Filter out empty tabindex/size. $attributes = array_filter($attributes);