logo

Recover Lost Form Submissions

Getting back to forms that throw errors when you submit them, I have a few tips to help you try and recover the lost data.

Let's say you fill in a form and submit it only for the server to return an error. There can be any number of reasons, but we'll assume it timed-out. Your first reaction might be to hit the back button and try again, only to find that all the fields on the form are now empty. Even that really long entry you typed in the "rich text" box! Well, don't despair, we can probably recover it all without having to re-type that novella all over again.

Depending on the type of error you see, it's often worth just hitting the refresh button before you get as far as using the back button. You'll see a message like below that warns you that the form contains data or something to that effect. Say ok and let the form re-submit. Hopefully you'll have better luck this time.

IE screengrab

If the error was generated by the server and is a page telling you to correct some fields, you have no choice but to press the back button and hope the field values are retained (I am still to work out why/how/when browser decide to retain values and when not to). Let's say they've been lost. Again, don't panic. All you need is a sniffer that lets you view the data exchanged between browser and server. I prefer this one, but it ain't cheap, so you might want to try Ethereal.

Start your sniffer app and make sure it's sniffing your connection. Now, press the forward button. This will probably show you a cached copy of the page with the same error on it. Now refresh that page. You'll see the same error generated by the server. Notice also that your sniffer app has logged the traffic from the retry, including all the field values. Sift through this log to find that the big fields and copy them back in. Bob's me dad.

I know it's not a perfect solution but it's saved me time in the past. Just remember not to panic next time it happens to you and have your sniffer at the ready.

Comments

    • avatar
    • pF
    • Mon 17 May 2004 05:51

    I'm pretty sure the reason why your browser forgets is because of the cache settings via the meta-tags (and/or) the ones set via HTTP commands. I'm sure I did a test a while back (whilst checking a form I did {Link})

    and so came to that conclusion. I ended up creating session variables, so users could go back & forth however they please without losing data. Oh and the post code lookup only works for the area of Shropshire, as we don't have anything else, or luckily require it.

    Oh and excuse the design, its a few years old – and luckily not one I did.

    • avatar
    • Henk
    • Mon 17 May 2004 06:34

    Live HTTP Headers is a very nice sniffer plugin for Mozilla Firefox.

    {Link}

    • avatar
    • Jake
    • Mon 17 May 2004 06:43

    Does LiveHeaders show the data sent as part of a POST request or just the headers Henk?

    • avatar
    • Henk
    • Mon 17 May 2004 16:22

    It shows the data of the POST request as well as the headers Jake.

    You should also take a look at the Web Developer plugin

    {Link}

    It offers tools for outlining block level elements, speed report, HTML and CSS validation and a lot more. Very handy for a web developer such as yourself

    • avatar
    • chief
    • Wed 2 Jun 2004 08:00 AM

    proxomitron's HTTP Message Log window enables viewing posted data. Its a proxy and its free.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Mon 17 May 2004

Share This Page

# ( ) '

Comments

The most recent comments added:

  • avatar chief about 20 years ago
  • avatar Henk about 21 years ago
  • avatar Jake about 21 years ago
  • avatar Henk about 21 years ago
  • avatar pF about 21 years ago

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content