Skip to content

Commit

Permalink
Fix for multiple forms not working
Browse files Browse the repository at this point in the history
  • Loading branch information
sleeuwen committed Sep 26, 2022
1 parent 7bfdcfe commit c1c602f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AspNetCore.ReCaptcha/ReCaptchaGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ public static IHtmlContent ReCaptchaV3(Uri baseUrl, string siteKey, string actio
content.AppendHtml(@$"<input id=""g-recaptcha-response-{id}"" name=""g-recaptcha-response"" type=""hidden"" value="""" />");
content.AppendFormat(@"<script src=""{0}api.js?render={1}&hl={2}""></script>", baseUrl, siteKey, language);
content.AppendHtml("<script>");
content.AppendHtml("function updateReCaptcha() {");
content.AppendHtml($"function updateReCaptcha{id}() {{");
content.AppendFormat("grecaptcha.execute('{0}', {{action: '{1}'}}).then(function(token){{", siteKey, action);
content.AppendHtml($"document.getElementById('g-recaptcha-response-{id}').value = token;");
content.AppendHtml("});");
content.AppendHtml("}");
content.AppendHtml("grecaptcha.ready(function() {setInterval(updateReCaptcha, 100000); updateReCaptcha()});");
content.AppendHtml($"grecaptcha.ready(function() {{setInterval(updateReCaptcha{id}, 100000); updateReCaptcha{id}()}});");
content.AppendHtml("</script>");
content.AppendLine();

Expand Down

0 comments on commit c1c602f

Please sign in to comment.