question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Html Recaptcha g-recaptcha-response value empty string

See original GitHub issue

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 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:closed
  • Created 3 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
agiletoolscommented, Oct 1, 2020

@shelland Thank you! I have this problem too. I use Razor Pages.

It helps me:: @(Html.Recaptcha(RecaptchaSettings.Value, new RecaptchaV3HiddenInput { IsAsync = false }))

3reactions
shellandcommented, Oct 1, 2020

@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>
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found