No more double submits in web forms

Usually, submit buttons in web forms should be clicked just once; but many users click them twice or more. Why? Because they’re used to launch actions by double clicking (as on Windows icons). Because the server doesn’t replies instantantly, and…

Usually, submit buttons in web forms should be clicked just once; but many users click them twice or more. Why?

  • Because they’re used to launch actions by double clicking (as on Windows icons).
  • Because the server doesn’t replies instantantly, and they click again “just to see if something happens”.

What’s the result? The form data is sent twice to the server, and users usually don’t realize it; they just get the response to one of the submits. Try this simulation to see what happens when submitting several times the form before the server response arrives:

reset

This is not a big issue if it’s, for instance, a search form: the query is being launched twice but the user simply gets the result. It may be annoying if someone is receiving the same mail several times just because users are submiting several times the contact form. And it’s a real big problem when the user is submiting a payment (you can be pretty sure they don’t want to pay twice the same object!).

The solution

There’s an easy solution for that problem! Simply disable the button just after the form is submitted, and you can change the button text too. The result is something like this:

reset

This is done using the onsubmit form event:

<form onsubmit=document.forms['formname'].submitbutton.disabled=true;
document.forms['formname'].submitbutton.value='Sending...';" action="action" name="formname">
  <!-- some form controls here -->
  <input value="Send" name="submitbutton" id="submitbutton" type="submit">
</form>

With this technique, you achieve two positive effects:

  • avoiding the double submit problem; and
  • giving feedback to the user confirming the submit

Of course, there’s no perfect solution. If JavaScript is disabled at the browser, it doesn’t works; if it’s really important avoiding multiple submits (for instance, when it’s an economical transaction), it should be done at server’s level.

It’s really simple to use and without negative effects. Try it if you are really tired of multiple submits and tell me how it goes!

Something I still miss in Google Analytics

Google Analytics has a nice new interface, much more intuitive and usable, but I still miss something I think it would be really usefull: an integrated calendar of events. I can select a range of dates at Google Analytics and…

Google Analytics has a nice new interface, much more intuitive and usable, but I still miss something I think it would be really usefull: an integrated calendar of events.
I can select a range of dates at Google Analytics and get different statistics: visits, unique users, etc. But there are many events (internal and external) that may affect that data. For instance:

  • Changes at the site: contents, layout, etc.
  • Changes in Google Analytics configuration (for instance, in filters)
  • Google Adwords campaigns linking to that site
  • etc, etc.

Any webmaster would be happy to know how those events are related to the statistics, wouldn’t they?

How could Google do that? We already have a solution: Google Calendar. So we simply would associate a site monitorized by Google Anlytics to a calendar in Google Calendar. A webmaster could add events to that calendar, and they would be shown at Google Analytics.

Here’s an example; this graph shows a decrease in the number of visits on June, 2nd:

Google Analytics graph (without events)

Hmmm… What happened that day? Oh, maybe that new filter to exclude inner visits. With the feature I suggest, I would link the Google Analytics account with a Google Calendar which includes events related to the site, like this:
(more…)