Is it displaying the reCaptcha element correctly? Could you debug into the validation method ("EPiServer.Forms.Samples.Implementation.Validation.RecaptchaValidator" function) to know anything went wrong?
I don't think you have to add any JavaScript to the page in order to make the recaptchaElement works.
After installing the package, i added the code
<script src="<%: Model.GetExtraResources().First().Item2 %>"></script>
<script src="<%: Model.GetExtraResources().Last().Item2 %>"></script>
in order to load in the RecaptchaElementBlock.js and the reCaptcha api. The recaptcha element loads in and show up.
However it seems like the validate method never gets called therefore always resulting in invalid captcha value. Am i supposed to call it manually?
Hi, you don't have to inject any script.
Recaptcha Element does it himself.
Have just tested with Forms 4.6.1 and Forms.Samples 3.3.2.
Sidenote: your site view template should have correct tag for registering client resources, please see it here.
Hi,
I am stuck with a similar situation. ive installed the episerver.forms.samples package and added the required javascript in order to display the recaptcha.
however when i submit the form, it always returns with the invalid captcha value error.
I have debugged into the validation method ("EPiServer.Forms.Samples.Implementation.Validation.RecaptchaValidator" function) and could find that that the GetSubmitted value function is returning null.
submitData = HttpContext.Current.Request.HttpMethod == "POST" ? HttpContext.Current.Request.Form : HttpContext.Current.Request.QueryString;
submitData["g-recaptcha-response"] is always null.
Hi, you don't have to add any script in order to use RecaptchaElement. See my previous post.
https://world.episerver.com/forum/developer-forum/episerver-forms/thread-container/2017/8/episerver-forms---recaptcha-not-working/#181409
Hi,
The captcha element is getting displayed but in the validator the submitted value is comming as null.
Hi,
I've verified the Forms Samples package 3.4.0 and it is working. Can you try with new fresh AlloyMVC site to make sure there is no custom code invoked during the submit process?
Hi Halima,
Please check your API keys Register Google API Keys
I've tried using Forms ver 4.11 along with Forms.Sample and it is still fine.
/Quan
ive installed the episerver.forms.samples package and added the required javascript in order to get the recaptcha working however when i submit the form, it always returns with the invalid captcha value error