onTimeout( )


Adds an event handler that runs when the CAPTCHA token expires.

The onTimeout() function allows you to perform actions when a CAPTCHA timeout occurs.

When a site visitor completes a CAPTCHA challenge, a token is generated. If 120 seconds pass without backend authorization, the token expires and onTimeout() is called.

When a timeout occurs, the reCAPTCHA element automatically resets and displays a message asking the site visitor to redo the challenge. If you enabled the clickable element for triggering a restricted operation when the CAPTCHA was verified, disable it.

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(): void The name of the function or the function expression to run when a CAPTCHA timeout occurs.

Did this help?