1

I've implemented a Sitecore 9 Forms Custom Submit Model referring to this article:

https://www.codinglittlethings.com/2019/10/sitecore-9-forms-google-recaptcha-field.html

The only difference is, I am using Google ReCaptcha V3 instead of V2 (as in above article)

I have placed my Custom Model above the SaveData method in the Form Action:

enter image description here

Now the issue is - when I hit the submit button, it successfully validates the Captcha and submits the form and returns true. When I press F5 (while debugging in Visual Studio), it again hits the break-point I have placed same Custom Submit Model and this time the Captcha validation fails (with duplicate error)

Please point out, what exactly is wrong.

1
  • Hello @SitecoreSXADeveloper, I am also facing the same issue, did you find any solution?. Thanks
    – Gautam
    Commented Apr 14, 2022 at 14:47

2 Answers 2

1

When you press F5, you resubmit the request with the same data. It's logical that the captcha payload is not valid anymore on the second request.

You could add a redirect submit action to have the form redirect on submit, so that F5 won't resubmit the request.

1
  • Hello Bart, I am sorry for not being clear. By F5 I meant in Visual Studio while debugging the code. And even without debugging I am unable to submit, since the method is called twice. I've edited my question. Commented Mar 10, 2020 at 13:54
0

In the forms setting, uncheck the "Ajax Enable" checkbox will solve the problem. But the only side affect is it will load the page and then will show the success message.

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.