I would like to have a confirmation warning if someone presses the reset button on a form on my site. I have seen it done, but I don't know how to do it. Basically, user presses reset button. Alert or Warning popup appears and asks if they are sure they want to clear the form. They select yes or no, and the appropriate action occurs.
Personally I don't ever use the reset button and stopped adding it to my sites a few years ago after people complained. You are right to try and implement a solution so people don't click it by accident but maybe you would be better removing it altogether?
After thinking about it, I think you're totally right. I don't even know why I still had the reset button on there. I think that it has been on there so long, that I never thought about removing it. Who every uses a reset button anyways when checking out out of a website.
I don't know if you still want need it but code is pretty simple: <form onreset="return confirm('Are you sure?')"> <input type="text" value="Inital value" /> <button type="reset">Do reset</button> </form> Code (markup):