I have an AMP page with a webform on. Originally, I used a recaptcha v2, but with AMP, only recaptcha v3 is available (because v2 add an additional script, and it's not accepted by AMP).
So I installed recaptcha-v3 module.
Without AMP, it work like a charm !
But with AMP, I can't submit my webform, because AMP require that form with POST method have a action-xhr attribute. But when I did it, on submit, I have the following error on my console :
[amp-form] Failed to parse response JSON: SyntaxError: Unexpected token < in JSON
I guess action-xhr wait for a JSON response, but webform return an HTML response...
I tried to add a submit action on my webform, to return a json response, but I don't access the recaptcha score...
And ideally, I would like to redirect the user after submission.
Also, I tried to use the amp-recaptcha-input tag, but it doesn't work : what name and data-action should I fill in ?
What is the right way to implements a recaptcha_v3 with webform on AMP page ?
Comments
Comment #2
dench0Comment #3
durancode commentedIt this solved?
Removing reCaptcha isn't an option.
Comment #4
dench0No, there are no plans to solve this problem.
Comment #5
durancode commentedThanks for the answer, I had to send the url to a canonical webform