This page explains how to enable and customize the invisible reCAPTCHA on your webpage.
This article is about to answer what Captcha, reCaptcha, securimage and invisible reCaptcha is and how to make it work effectively. Check my internet connection speed test. The most common type of Captcha was originally invented in 1997. This form requires users to type the letters of a distorted image, sometimes with the addition of an obscured sequence of letters or digits.
- Enable a ReCaptcha plugin of your choice in Joomla. Go to 'Extensions' 'Plugins': This will bring you to the 'Plugins' screen with the list of Joomla plugins. Find the 'Captcha - Invisible reCAPTCHA' and click on its title to open it up for editing: You will see the 'Plugins: CAPTCHA - Invisible reCAPTCHA' screen.
- When I try now and use the Captcha Type option the only option is 'Google reCaptcha.' Let me know if you need further information or if I am not being clear in my query. 3.9 Invisible Recaptcha Option.
- Joomla comes with two separate system plugins for CAPTCHA - reCAPTCHA and CAPTCHA - Invisible reCAPTCHA. By default, they are set to disabled. So you need to enable them. To enable, navigate to Extensions Plugins, search for Captcha.
To invoke the invisible reCAPTCHA, you can either:
- Automatically bind the challenge to a button or
- Programmatically bind the challenge to a button or
Google Recaptcha Api Keys
See Configurations to learn how to customize the invisible reCAPTCHA. For example, you may want to specify the language or badge location.
See Verifying the user's response to check if the user successfully solved the CAPTCHA.
Automatically bind the challenge to a button
The easiest method for using the invisible reCAPTCHA widget on your page is to include the necessary JavaScript resource and add a few attributes to your html button. The necessary attributes are a class name 'g-recaptcha
', your site key in the data-sitekey
attribute, and the name of a JavaScript callback to handle completion of the captcha in the data-callback
attribute.
The script must be loaded using the HTTPS protocol and can be included from any point on the page without restriction.
Programmatically bind the challenge to a button or invoke the challenge.
Deferring the binding can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource. This works the same as the normal reCAPTCHA challenge. Lol register.
Programmatically invoke the challenge.
Invoking the reCAPTCHA verification programmatically can be achieved by rendering the challenge in a div with an attribute>grecaptcha.render method from the JavaScript API.
Your onload callback function must be defined before the reCAPTCHA API loads. To ensure there are no race conditions:- order your scripts with the callback first, and then reCAPTCHA
- use the `async` and `defer` parameters in the `script` tags
The script must be loaded using the HTTPS protocol and can be included from any point on the page without restriction.
Programmatically bind the challenge to a button or invoke the challenge.
Deferring the binding can be achieved by specifying your onload callback function and adding parameters to the JavaScript resource. This works the same as the normal reCAPTCHA challenge. Lol register.
Programmatically invoke the challenge.
Invoking the reCAPTCHA verification programmatically can be achieved by rendering the challenge in a div with an attribute>grecaptcha.render method from the JavaScript API.
Your onload callback function must be defined before the reCAPTCHA API loads. To ensure there are no race conditions:- order your scripts with the callback first, and then reCAPTCHA
- use the `async` and `defer` parameters in the `script` tags
How Does Invisible Recaptcha Work
Configuration
JavaScript resource (api.js) parameters
Parameter | Value | Description |
---|---|---|
onload | Optional. The name of your callback function to be executed once all the dependencies have loaded. | |
render | explicit onload | Optional. Whether to render the widget explicitly. Defaults to onload, which will render the widget in the first g-recaptcha tag it finds. |
hl | See language codes | Optional. Forces the widget to render in a specific language. Auto-detects the user's language if unspecified. |
g-recaptcha tag attributes and grecaptcha.render parameters
g-recaptcha tag attribute | grecaptcha.render parameter | Value | Default | Description |
---|---|---|---|---|
data-sitekey | sitekey | Your sitekey. | ||
data-badge | badge | bottomright bottomleft inline | bottomright | Optional. Reposition the reCAPTCHA badge. 'inline' lets you position it with CSS. |
data-size | size | invisible | Optional. Used to create an invisible widget bound to a div and programmatically executed. | |
data-tabindex | tabindex | 0 | Optional. The tabindex of the challenge. If other elements in your page use tabindex, it should be set to make user navigation easier. | |
data-callback | callback | Optional. The name of your callback function, executed when the user submits a successful response. The g-recaptcha-response token is passed to your callback. | ||
data-expired-callback | expired-callback | Optional. The name of your callback function, executed when the reCAPTCHA response expires and the user needs to re-verify. | ||
data-error-callback | error-callback | Optional. The name of your callback function, executed when reCAPTCHA encounters an error (usually network connectivity) and cannot continue until connectivity is restored. If you specify a function here, you are responsible for informing the user that they should retry. | ||
isolated | false | Optional. For plugin owners to not interfere with existing reCAPTCHA installations on a page. If true, this reCAPTCHA instance will be part of a separate ID space. |
JavaScript API
Method | Description |
---|---|
grecaptcha.render( parameters ) | Renders the container as a reCAPTCHA widget and returns the ID of the newly created widget. container The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself. parameters An object containing parameters as key=value pairs, for example, {'sitekey': 'your_site_key', 'theme': 'light'}. See grecaptcha.render parameters. inherit Use existing data-* attributes on the element if the coorsponding parameter is not specified. The values in parameter will take precedence over the attributes. |
grecaptcha.execute( opt_widget_id ) | Programmatically invoke the reCAPTCHA check. Used if the invisible reCAPTCHA is on a div instead of a button. opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. |
grecaptcha.reset( ) | Resets the reCAPTCHA widget. opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. |
grecaptcha.getResponse( opt_widget_id ) | Gets the response for the reCAPTCHA widget. opt_widget_id Optional widget ID, defaults to the first widget created if unspecified. |
Examples
Explicit rendering after an onload callback
Invoking the invisible reCAPTCHA challenge after client side validation.