reCAPTCHA 2 triggers an error of 'excessive recursion'

I have decided to incorporate bootstrap 4 into my current Umbraco CMS project.

My goal is to integrate reCAPTCHA 2 into a registration form, but I am encountering some difficulties in the process.

I have successfully generated the keys for the reCAPTCHA and stored them in the web.config file for future use.

Below is a snippet of the code detailing my attempts:

Added the following scripts at the end of the header tag:

<script src="https://www.google.com/recaptcha/api.js" async defer></script>

The structure of the form appears as follows:

@using (Html.BeginUmbracoForm<AccountSurfaceController>("RegisterUser", null, new { id = "RegisterForm" }, FormMethod.Post))
{
    @Html.AntiForgeryToken()
    <div class="form-group">
        <div class="alert alert-info alert-dismissible fade show" role="alert">
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
            <small>Te gjitha fushat e meposhtme duhen plotesuar.</small>
        </div>
    </div>

    <!-- Add more form elements here -->

    <div class="form-group">
        <div class="col-6">
            <label for="captchaContainer" class="form-control-label">Captcha:</label>
        </div>
        <div class="col-6">
            <div id="captchaContainer" class="g-recaptcha" data-sitekey="@ConfigurationManager.AppSettings[DictionaryKeys.ReCaptchaPublicKey]"></div>
        </div>
    </div>
      <button type="submit" class="btn btn-primary">Regjistrohu</button>
}

I have searched through similar questions on Stack Overflow, unfortunately none of the solutions provided were able to resolve my issue. Although the reCAPTCHA element does appear on the page, clicking it triggers an 'too much recursion' error in the console with no visible result.

https://i.sstatic.net/f589b.png

If anyone has encountered this problem before or knows what might be causing this issue, your insights would be greatly appreciated. Thank you in advance.

Answer №1

After some investigation, I stumbled upon a rather peculiar issue.

It turns out that my webpage contained more than one form.

The first form had the obligatory recaptcha, while the other forms did not. However, these additional forms did include a hidden field like so:

<input name="tagName" type="hidden" value="array" />

This seemingly innocuous field was causing all the trouble. By simply changing the name attribute to something different, such as:

<input  name="anotherName" type="hidden" value="array" /> 

I was able to resolve the issue. It appears there may be a flaw in the logic of recaptcha when dealing with this particular scenario involving a name attribute equal to "tagName."

Nevertheless, I will be sure to communicate this anomaly to the recaptcha team. I hope to shed light on whether this is indeed a bug or if there is something crucial that I am overlooking.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

How to efficiently update a nested array within the state of a React

Although the onChange function is working as expected, I am facing issues with updating the features in the state. Despite numerous attempts, I haven't been able to find examples similar to what I'm trying to achieve, so I decided to seek help. ...

Error: The provided `anchorEl` property for this component is invalid

While working on my React 18.2 app with MUI 5.10.5, I encountered an issue trying to create a <Menu /> element that should open when a button is clicked. The menu does appear, but the positioning seems off as it displays in the top-left corner of the ...

Tips on how to showcase particular keys from json information in React

Here is a sample of Json data that I have: [ { "serial_number": "test1", "added_at": "2021-02-05T18:58:43.382943Z", "ser_mod": [ { "added_at": "2021-02-06T02: ...

JavaScript function unable to access static file for image

I need assistance with dynamically displaying an image (a checkmark or "X") based on a variable. When I insert the image using a script directly in the HTML file, it functions correctly. However, when attempting to set the image from within the createEasyD ...

Steps for adding products to your shopping cart without using a JavaScript framework:

As a newcomer to web development, I took on the challenge of creating an e-commerce website using only HTML, CSS, and vanilla JavaScript (without any frameworks). I've encountered a roadblock while trying to implement the "Add to Cart" functionality ...

Looking for tags similar to stackoverflow?

Is there a way to create a search box similar to the one in Tags where tag names are displayed immediately upon entering without pressing enter key? Could anyone provide me with a script or tutorial on how to achieve this? Is it done using JavaScript or j ...

Explore within another map and analyze the node to spot the differences

I have some questions about iterating through a JavaScript Object and using array functions in JavaScript. Let's assume I have the following variables: var json1 = "[{"id": 1, "name":"x"}, {"id": 2, "name":"y"}]"; var json2 = "[{"id": 1, "name":"x"}, ...

Ways to increase the count in Vue Class Bindings?

Trying to utilize Vue class bindings, but uncertain about the syntax for bindings. I aim to append a numeric value to the class attribute, for instance class = "allstar50", then employ class bindings with the v-for directive to display a list of text items ...

Modify request parameters in real-time using JavaScript

i am seeking assistance with a link request: <a href=index.jsp></> also, i have various divs located elsewhere on the page that contain changing values based on user input or specific conditions: <input id="var1" /> <input id="var2" ...

Generate PDF Files Using Ajax

Currently, I am utilizing FPDF to generate my report. $pdf = new Report('P','mm','A4', $_POST); $pdf->AddPage(); $pdf->Output('file.pdf','I'); Furthermore, I am employing ajax to send a request to t ...

What is the best way to access and display the innerText of elements that have been removed using console

When I call the updateCartTotal() function, my goal is to display in the console the items that have been removed from the shopping cart. Every time I click on the remove button, I want it to show the item and the price. However, instead of displaying the ...

What could be causing the carousel to be hidden in a Next.js project?

My project involves utilizing the react-multi-carousel component to display a maximum of two stock photos. I made modifications to the next.config.js file as well. import Image from "next/image"; import Carousel from "react-multi-carousel&qu ...

Preventing page refresh when typing in a form input: Tips and tricks

I'm currently puzzled by a small issue. In my web application, I have a chat box that consists of an input[type='text'] field and a button. My goal is to send the message to the server and clear the input field whenever the user clicks the b ...

Adding the classname "active" in ReactJS can be achieved by utilizing the `className` attribute within

I am facing an issue with adding the active classname in my code. Can anyone suggest a solution to add the active classname for this section: <li onClick = {() => onChangeStatus({status: 'on-hold'})} className = {appState === {'status& ...

Tips for showing solely the current page number within angular pagination

HTML : <!-- pagination controls --> <div class="pagination-container"> <pagination-controls (pageChange)="onPageChange($event)" [maxSize]="1" [id]="config.id" [directionLinks]="true">< ...

What is the best way to manage multiple arrays?

There is an array containing multiple arrays within it. I am trying to locate the specific sub-array that contains an object with name: "tax-payer-identification". Once found, I need to set the variable's value from required: true to false. ...

Leveraging asynchronous response data within asynchronous components

Here's the structure of a parent component and a child component: export default { name : 'parentNode', mounted: function () { var that = this; if (that.$store.state.auth.isAuthenticated) { that. ...

Decreased storage space requirements following transfer to S3 bucket using nodejs

I am currently facing an issue with uploading files from a specific folder location to an S3 bucket using the nodejs aws-sdk. The files I am working with are deepzoom images (.dzi). While the files seem to be successfully uploaded to my S3 bucket, I have n ...

What is the best way to pass a variable value from a JavaScript function to a Python function within a Django framework

My goal is to use HTML and JavaScript to scan a QR code in nurse_home.html. I have successfully scanned and viewed the content of the QR code on the website, but I am facing an issue with POSTing the QR code output represented by <output type='POST ...

Dealing with file upload dialog using Selenium web automation

I am having difficulty managing the 'select files to load' dialog using Selenium WebDriver. Here is the HTML code snippet: <form class="upload"> <button class="btn" data-capture="" type="button">Browse</button> <inpu ...