Receiving multiple entries for a single form

I have a simple product signup form that is working just fine but seems to be sometimes (and not always) recording multiple entries in the netlify dashboard. I can’t figure out what conditions lead to multiple entries vs. one entry as expected. Nor could I find anything in the forums describing this situation, so any help or pointers are appreciated.

Site: peoplepartylandingpage.netlify.app

Public URL: peopleparty.app

Form is vanilla HTML. Here’s the relevant code:

    <form data-netlify="true" action="/?yay" method="POST" name="product_signups">
        <input type="email" name="email" placeholder="someone@somewhere.com"
        onfocus="this.placeholder = ''"
        onblur="this.placeholder = 'someone@somewhere.com'" />
        <br/>
        <button id="submit" type="submit">SIGN UP</button>
    </form>

I asked one of the users whose email showed up multiple times in our dashboard and they said there was no issue submitting the form, so it seems that whatever is happening may be behind the scenes and not the result of user behavior. Though wondering if it depends on the browser/device. Thanks for any advice!

On your page, I see this: <input type='hidden' name='form-name' value='product_signups' />, which, apparently doesn’t exist in the code you posted.

That might be the cause.

Thanks for the response, @hrishikesh. My understanding from the docs is that this line is automatically added by Netlify…

When Netlify bots parse the static HTML for a form you’ve added, they automatically strip the data-netlify="true" or netlify attribute from the <form> tag and inject a hidden input named form-name . In the resulting HTML that’s deployed, the data-netlify="true" or netlify attribute is gone, and the hidden form-name input’s value matches the name attribute of <form> like this:

Oops, my bad. I had read the documentation several times but still missed it.

Well, leaving aside that blunder of mine and coming back to your topic, are those being counted as multiple entries by Nelify, that is, is the count of available free submissions going down faster than expected?

Yeah great question and I thought of the same thing… it looks like the response is not being counted as three against the "verified submissions” but hard to confirm because I cannot reproduce the issue even though I see people are clearly continuing to have the issue because I have multiple triplicate entries in the dashboard.

If it was counting as multiple entries, somehow your code was submitting the form thrice, but, since that’s probably not the case and that your form seems normal, that’s a really tough nut to crack. Probably @jen can help.

I have a hunch, could you try removing the action=/?yay on the form tag and see what happens?

Yeah my bad I think that wouldn’t have done anything.

I did note that by navigating back/forward, or by refreshing, the form is reposted. So maybe you could check there?

Ahh, good idea. But I can’t reproduce here. My browsers are showing the “confirm form resubmission” screen. Argh.

Well, maybe you can try using AJAX to submit it. If it’s somehow the browser is messing up, maybe using AJAX might fix it as there won’t be ‘page reloads’.

Appreciate the suggestion and I guess I can do that but it’s not my favorite solution because that means I need to rewrite my code when this is actually the most simple possible form that should be functional without ajax per the Netlify docs, unless I’m missing something. It’s practically a textbook example of netlify forms! And it’s malfunctioning… so seems like a Netlify issue that should be fixed?

That’s perfectly correct and it will be fixed if at all it’s really an issue. But since no one else is having the issue, it might not be the case. So, using AJAX might be a workaround till the time you get some official support or a fix.

You’re very right about the fact that it’s a simple form and it should have worked. Maybe there’s something very obvious and trivial that’s wrong, but, we can’t seem to be able to see it.

1 Like

Haha I don’t get the confirmation. Frustrating indeed! Welp I guess this is out of my expertise now. I guess it’s just a matter of time before an expert from Netlify checks it out for you.

Good luck!

1 Like

Hi, @bryanboyer. We do see reports of sites being designed in such a way that the site can cause a duplicate submission of the form data. This might be done by reopening the page later or navigating with the browser forward and back buttons.

When this happens, it is controlled by the site code running in the end user’s browser. The duplicate submissions are controlled by the HTML and javascript of the site - code you control - not Netlify.

Our service isn’t incorrectly reporting false duplicate submissions. Real duplicate submissions are being sent and we simply reporting what is happening.

Our support team can troubleshoot what Netlify does but we don’t have the resources to troubleshoot third-party code. Third-party code isn’t covered by the scope of our technical support. Someone else may be able to assist with troubleshooting the site code and the question is still welcome here. I just want to be clear about the limits of what our support team has resources to assist with.

Thanks for the ping @hrishikesh (and happy birthday!!! :birthday:) I was out since Sunday-Monday is my weekend, but back and catching up now.

@bryanboyer, can you say how the ?yay path works? The way our form actions work is that we take the path assigned to that attribute and return the page with the same name. We expect an HTML path there, but I don’t see a page with that name in your site. Wondering if this could be the cause of the double/triple submissions.

1 Like

@jen and @luke thanks.

The path of /?yay maps to index.html?yay, so when the form is submitted it goes back to the same page that contained the form in the first place and vanilla JS changes the appearance to be a success screen.

Will rewrite it to go to success.html or similar and break the success page out to a separate HTML file and path to see if that helps.

1 Like

I’d expect that to work better, please let us know how it goes.

After some weeks of having this in production, it seems to be fixed. Thanks!

1 Like

I have the same issue, but in my case the submit action leads to a dedicated page that’s different from the index.html. What are other reasons this could be happening?

Until today, I was using action="thank-you" and after looking at docs again I changed it to action="/thank-you". Both seem to work though, and I don’t expect that to be the difference.

Moreover, I can share that I have three forms, and this only happens with one. They all lead to the same thank-you page. Two of them are on their own dedicated pages, and one is on index.html. We only got duplicates on the one from index.html (but this could also be because the other ones have very few responses so far).

thank you in advance for your time

Hi, @janek. To troubleshoot this we will need links to the actual forms so we can test them. Would you please post the URLs for the pages with the working and not working forms?

of course, sorry about that. Here’s the problematic form on a test (staging) host:
https://app.netlify.com/sites/connected-spaces/forms/6012d96467b2f20008d3e184

An example form that I thought was fine is this:
https://app.netlify.com/sites/connected-spaces/forms/6012d9f64e12d80007d7c70e#item-601d28fa2f9637b30f553ed6
…but I was also able to get duplicates there when I tried to click submit very fast. I think it just didn’t happen in production, because less people fill it out, and they’re also taking their time.

These on my account are for testing purposes, I have the production forms on another account and I will post them below.

Both pages are connected to the same codebase so they should be no different.