Search code examples
javascriptjsf-2recaptchacommandbutton

Disable submit button after a reCaptchaV2 timeout


How to disable a submit button after a reCaptcha V2 timeout?

Like I need the button to be disabled when this message is visible on reCaptcha widget.

Verification expired. Check the checkbox again.

I'm disabling and re-enabling the submit button based on reCaptcha response as of now but couldn't figure out a way to link it with timeout. Any leads preferably using JS would be highly appreciated.


Solution

  • Add a expired-callback attribute and callback or configure this callback in the Recaptcha configuration.

    Answering in kind. If you need help with code, please provide some examples and I'll be happy to assist.