Auto Save Form Processing Previous Form Submission
1) Script Title: Auto Save Form script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tosaveform.htm
3) Describe problem: LOVE it....except for one flaw.....and it is a biggie. I have a site where users enter multiple customer phone calls with many details. Seems the Backspace (also navigational) is causing some issues if they are not in focus on a field....this seemed to be the perfect solution and works (well kind of...) until a second or third, etc call is added. Then if they hit the Backspace it takes them to the form unavailable page in the browser, but when you click on "try Again" it is resubmitting the previous call to the database....not taking you to the new form....until you start in to add a new call, then the fields populate with what was saved....but you have that "extra" call to delete.
Also noticed before (on the first call entered) it took you back to the screen just before the form where properties are selected....not to the form itself - have id in form as required, but the selector is in a previous file that leads to this one. This was not optimal, but could be "explained" because once the property was selected and the new form showed up within seconds the data was back that had been entered. How would I get it to not resubmit data to the database? Seems it is also caching the "submit" button?
Hmm what you're describing seems to just be the default behavior of most browsers- when you press the "backspace" key while the focus is not on a form element, it acts as the "back" button, taking the user back one page in the browser history. If the form was previously submitted, that could mean a "form unavailable" page.
To confirm the above- what happens if you remove or disable the Auto Saving script- does the problem go away with the form submission issue?
Without the Auto Save, if someone takes focus off a form element and hits Backspace all is lost, takes them to a Document Expired (or the like depending on browser) page.
With Auto Save, it saves things like a charm! Except if you hit Backspace while out of focus on the first call you enter it makes you re-select the property, but when you come back to the main call entering form, after a brief second the data populates the fields. That is something I could live with and explain away....but it is what happens on the second, third, etc... call (and this form is used by people entering hundreds at a time)...if you take focus off and hit Backspace then it resubmits the previously submitted/saved call. The data that was auto saved is still there when you return to the call entering form (which is good), but you have that nasty "extra" call you have to go in and delete.
Is there a way to unset HTML5's DOM storage? after the form is submitted? Is that where the issue is?
Any help would be appreciated. I am about to yank it from my testing pages as it is delaying the whole project...