Html Recaptcha g-recaptcha-response value empty string
See original GitHub issueHello. I’ve used this lib with great success in my .net core 2.2 project. Now i’m migrating to .net core 3.1, and I can’t seem to get it to work. I’ve followed your example of setting it up, but I can’t get a value in g-recaptcha-response
<input id="g-recaptcha-response" name="g-recaptcha-response" type="hidden" value="">
This is what i see when I inspect my html.
@(Html.Recaptcha<RecaptchaV3HiddenInput>(RecaptchaSettings.Value));
The above is how I insert it it. It appears to correctly get the settings. Do you have any idea why this might happen?
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
javascript - Invisible reCAPTCHA sending empty g- ...
I am trying to use Google Invisible reCAPTCHA, but it is sending empty the g-recaptcha-response POST parameter when i have multiple forms in ......
Read more >g-recaptcha-response is ALWAYS EMPTY
I have a site key registered. When I solve the captcha I get back a textarea with id=g-recaptcha-response, but it's always empty.
Read more >Invisible reCAPTCHA
The HTML element to render the reCAPTCHA widget. Specify either the ID of the container (string) or the DOM element itself. ... An...
Read more >Html Recaptcha g-recaptcha-response value empty string
Hello. I've used this lib with great success in my .net core 2.2 project. Now i'm migrating to .net core 3.1, and I...
Read more >FAQ about reCAPTCHA v3 - Contact Form 7
reCAPTCHA v3 is Contact Form 7's officially supported CAPTCHA solution. ... replaced by an empty string, so it is not necessary to remove...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@shelland Thank you! I have this problem too. I use Razor Pages.
It helps me::
@(Html.Recaptcha(RecaptchaSettings.Value, new RecaptchaV3HiddenInput { IsAsync = false }))
@TimothyMeadows
Seems like I could found a reason of this issue:
grecaptcha.ready is not being called because main JS file is loaded using “async defer”. Recaptcha documentation says that you should embed JS script in the following way:
<script src="https://www.google.com/recaptcha/api.js?render=reCAPTCHA_site_key"></script>
without “async defer” attributes. In this case everything works correctly. Currently JS file is linked with the following code:
<script src="https://www.google.com/recaptcha/api.js?render=SOME_KEY&hl=en" async defer></script>