View Full Version : Is it possible to have an "Undo" with a form reset?

09-27-2005, 01:09 AM
I have a simple score calculator and I was just curious to know if there was a way to be able to undo the reset option. (I think that is how I want to put it.)
Meaning, you put in all scores and got final total, then hit reset and went "oops I forgot what my score was". You could click undo and have your scores back.
Sorry, if I am not making any sense I am very new to all of this. You can see what I am talking about here http://dobbers.offline.org/scorecard
There are two different ones, but they both do the same thing.
If it is not possible, then that is fine. I will just have to put in a little note about making sure everything is correct before hitting reset. Thank you in advance for your time/help/effort. I truly appreciate these forums!
(I hope posting the links is ok, instead of the actual script.)

09-27-2005, 01:55 PM
<input type="reset" onclick="return confirm('Do you really want to reset? All the values will be lost.')" value=" Reset " />

09-30-2005, 03:30 AM
I will take that as a NO. Thank you for your help. I have added that line. ;)

09-30-2005, 10:27 AM
It's possible but it would be easier to just implement the confirmation message.
But if you still want to have an Undo button even with the confirmation message, all you need to do is store the entered values of the fields before the reset is done. Then when Undo is clicked, retrieve those values and then sets them to their corresponding fields.