Thursday, 24 June 2010

Easy form reset confirmation snippet

Just add
onclick="return window.confirm('Clear the form?')"

to the reset button.

e.g.
<input type="reset" onclick="return window.confirm('Clear the form?')" />

gives this...