More information about the Underscore mailing list

[_] Check if user has changed anything on form since last save

Tom Gidden tom at
Thu Dec 17 12:57:14 GMT 2009

On 17 Dec 2009, at 10:44, Hamish Atkinson wrote:
> Has anyone got any better/more elegant ideas (or can point me at form
> frameworks (PHP and/or javascript) that do this)?

I can't say I've thought about the usability of this, but purely from a technical perspective, there's an alternative:

Add an onChange to each field -- use JQuery to make this a lot easier -- and store the value of each form entry in a cookie with a relatively short expiry time.  Then, if they exit the page prematurely and then return, the fields get filled in.  Completing the form correctly (either by Submit or Discard Changes) would clear the cookies.

Admittedly, HTML forms are prone to loss of information.  However, it is expected behaviour, so beware of changing it... make your changes to that behaviour unobtrusive and uncomplicated as possible.

Just a thought.


Tom Gidden