One of the worst things that can happen when a user is entering data into an
INPUT type="text" or
TEXTAREA element is an accidental browser reload or even crash- all the data is instantly lost, to the horror of the user. This script uses HTML5’s
sessionStorage to store the text entered into these fields as the user types, and recalls them in an event of a page refresh or even browser crash (FF3.5+ only). The script works in IE6+, FF3.5+, Google Chrome and Safari 4+.
//call this function at the END of your page
//SYNTAX: rescuefieldvalues(['fieldid1', 'fieldid2', 'etc'])
rescuefieldvalues(['address', 'feedback']) //rescue data entered for form fields
"address" and "feedback"