Receiving multiple entries for a single form

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:

An example form that I thought was fine is this:

…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.

this is @janek writing from my client’s production account. The form in question is:

About 15% of answers there are duplicates. I was able to speak with 2 of the people that submitted them, and they were both in Safari for iOS. I was able to reproduce the issue on desktop just by clicking the submit button really fast.

As a developer, I feel like everything is done as per your docs, and almost too simply to be buggy (plain HTML, no frameworks).

I absolutely do not feel you should be obliged, but I would feel very grateful if you would credit this account with a higher response limit for forms for this month, in light of this (especially if you need a few submissions for your debugging).

Please let me know if I can assist you in debugging this further.

Hi, @connected-spaces. See four pairs of duplicate submissions (using a criteria of two submissions in a row with the same email address).

The only thing that sticks out to me is that all four duplicates were reporting AppleWebKit in their user-agent strings.

This confirms that, for the clients that sending the form submission twice, they all were using the AppleWebKit browser engine. In fact, one user agent shows an Android device but that user-agent also says “AppleWebKit”. Maybe they were using Safari on Android but it does appear to only happen with AppleWebKit user-agents.

I hope this helps narrow down the issue. I’ve also issued an adjustment for the forms usage and you can downgrade back to forms level 0 now here:

​Please let us know when you have completed the downgrade and we will make sure you are not billed for the prorated time window when forms level 1 was active. (To be clear, we need the downgrade to be complete before we can successful adjust the difference so there is no charge.)

If there are questions about any of this, please let us know.

Hey there, @jdco :wave:

Welcome to the Netlify Forums and thanks for reaching out about this. Sorry that you are having form submission issues.

One of our engineers has looked into this. If you submit a form, it will create a form submission and redirect you to /thanks . If after that you refresh the page (while being on the thanks path), a new form submission will be triggered. In theory, this can also explain why the fourth submission happened significantly later. Let’s imagine the following series of events:

  • Your site visitors submits a form and leaves the tab open
  • Then, they close the computer but leave the browser open
  • Later, upon logging in, the browser reloads every open tab, causing another form submission

Let me know if this gets you on the right track. If you have further follow up questions, please let us know!

Thanks @hillary

From what I’m seeing the recommended way to deal with this is a “post-redirect-get” flow. Where the post gets handled and redirected to a get. I’ve tried finding some guides/tips in the Netlify documentation, but am not seeing any.

The implementation I had used was directly from the documentation (Forms setup | Netlify Docs, specifically the success messages section). Is there something missing from the documentation about how to resolve this behavior?

You shouldn’t need to build anything like that unless you are REALLY bummed out by an occasional duplicate post; I never advise anyone to do anything except accept POSTs to their endpoint directly, so no, I wouldn’t say anything is missing from the docs for handling this rare edge case.

It’s true; you could receive duplicates, yes, but I wouldn’t expect that it happens often enough to need you to do anything about it except ignore them yourself as you respond to the submitters? If it does, we’ve only really seen this in bulk from mobile users (who can leave a page open on their mobile device, and some of those browsers seem to repost form contents triggering multiple submissions), so then perhaps it makes sense to have the redirect flow (but you could do it client side using <meta refresh...>).

Another flow you could use is to use the event-triggered function to process your form submissions: Trigger functions on events | Netlify Docs . That would allow you (should you want to) to do an API lookup of past form submissions (Get started with the Netlify API | Netlify Docs) to avoid “doing whatever it is you don’t want to duplicate”, which wouldn’t require changes to your front-end.