After each submission, send the visitor on to a separate thank-you page instead of showing the message in place, and have the server ignore a repeat of the same form. Refresh then reloads the thank-you page only.

Two copies of the same request

On Monday the office inbox holds two quote requests from the same person, three minutes apart, identical down to a spelling mistake in the street name.

Later that week an order arrives twice. Someone calls the customer to ask whether they really wanted two, and the customer is puzzled: they pressed the button once.

They did press it once. What they pressed afterwards was refresh, or the back button, and the browser sent the form a second time.

What happens when a form is sent

A web form sends its contents to the server in a request that does something: an email goes out, an order is recorded. The server then answers with a page.

On many older sites that answer is the thank-you message itself, shown at the address the form was sent to. To the browser, the page on screen is the result of sending the form.

Reloading it means repeating whatever produced it. The browser warns first, in a box saying the information will be sent again, but the wording is technical and the button to carry on is the obvious one.

Ordinary habits that resend a form

Visitors are not being careless. A few everyday habits send a form twice:

The last two are the form's fault rather than the visitor's. A button that does not react, or a confirmation that blends into the page, invites another try.

What a duplicate costs

A duplicate quote request means two people may answer the same enquiry, or one person prices it twice. A duplicate order can mean a second delivery, a second charge or an awkward phone call.

Customers notice. Being asked whether they meant to order twice is a small thing, but it makes the business look unsure of its own paperwork.

Repeats also spoil the counts. Enquiry totals look higher than they are, and any measure of completed forms is inflated by every resend.

A separate thank-you page

The remedy is a long-established pattern. When the form arrives, the server records it, sends the email, and then tells the browser to go to a different address: the thank-you page.

The browser fetches that page with an ordinary request that changes nothing. Refresh reloads the thank-you page. Back and forward move between pages without sending anything again.

The page can also say what happens next: who will reply, by when, and a phone number for anything urgent. A visitor who knows what to expect has no reason to try again.

It gives analytics a clean thing to count, too. Each visit to the thank-you page is one completed form, and a goal can be set on its address.

A check on the server

A separate page stops most repeats, but not a quick second click or a visitor who goes back to the form and sends it again. For those, the server needs its own check.

The usual method is a one-time code placed in each form as it is displayed. The server accepts the first submission carrying that code and ignores any later one.

A simpler check compares each submission with those of the last few minutes. An identical one from the same email address is set aside instead of being sent on.

The send button can also be disabled for a few seconds after the first click, with a short note that the form is on its way. That takes away the reason for a second click.

A worked example

A commercial bakery in the Comox Valley bakes bread and pastries overnight for coffee shops, restaurants and grocers. Customers place next-day orders through a form on its website before an afternoon cutoff, and the night shift bakes from the list.

Every week or two an order arrived twice. One morning a coffee shop received two dozen croissants it had never wanted, and after that the office phoned customers about any order that looked familiar.

The form showed its thank-you message at the address it was sent to, in small type below the form. Customers refreshed to check, or pressed send again without noticing the message.

The form now sends each order on to a thank-you page that repeats the order, names the delivery morning and gives the office number. A one-time code in each form lets the server drop any repeat.

What a customer reloads now is a confirmation, not the order itself, so the habit of checking twice no longer reaches the night shift's baking list.

Testing the forms you have

Each form can be tested in a few minutes. Send a test, then press refresh on the message that appears. If the browser warns that it will send information again, that form has the problem.

Try the back button and then forward, and click send twice in quick succession. Then count what arrived in the inbox.

Test every form on its own: contact, quote request, booking and order forms. They were often built at different times by different people, and they rarely behave alike.

The counter-case

A contact form that brings in a few messages a week may produce an occasional duplicate that takes seconds to delete. For that form alone, the change can wait for the next round of site work.

Forms that start work are another matter: orders, bookings, deliveries, appointments and anything that charges a card. None of those should depend on the visitor leaving refresh alone.

The changes are small for whoever maintains the site, and they make the confirmation more useful as well, so they are worth making wherever a repeat would cost something.

Stopping the second copy

  1. Send a test through each form on the site.
  2. Press refresh on the message that appears.
  3. List every form that asks to resend.
  4. Move the thank-you message to its own page.
  5. Say what happens next on that page.
  6. Add a one-time code that the server checks.
  7. Set a goal on the thank-you page's address.

Step four removes most duplicates by itself, because the page a visitor reloads no longer sends anything. The server's check then catches the quick second clicks and repeat attempts that remain.

Forms that fail in one browser, so that the enquiry never arrives at all, are examined in enquiries that never come from one browser.


Frequently asked questions

Why do some enquiries arrive twice?

The thank-you message is the result of sending the form, so refreshing it, or going back and forward, sends the form again. Clicking send twice does the same.

What is the browser warning about resending information?

Browsers warn before repeating a form submission, but the message is technical and the button to continue is the obvious one. Many visitors click past it without reading.

How does a separate thank-you page help?

The server records the form, then sends the browser to a different address. Reloading that page simply fetches it again, so nothing is sent a second time.

Does a thank-you page stop a second click?

Not entirely. A one-time code in each form lets the server ignore repeats, and disabling the button after the first click removes the reason for a second.

How can I test my forms for this?

Send a test, then press refresh on the message that appears. If the browser warns that it will send information again, that form needs a separate thank-you page.

Does this affect analytics?

Yes. Repeats inflate any count of completed forms. A separate thank-you page gives one clean address to set as a goal, visited once for each real submission.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Orders arriving twice from your website?

Tell us which forms send duplicates, and we will test each one and suggest the change it needs.

Start a Conversation