Validate a Reset Button
If you’ve ever wanted to have a reset button confirm the reset so that people dont accidentally reset a long form and get frustrated this works well. Basically you create you’re own button for the reset. Where i have “frmInvitation” input the name of your form “frmname”.
View as text
<Input type="button" value="Reset" onclick="confirmReset()"/>
<script type="text/javascript">
function confirmReset() {
if(confirm("Are you sure you want to reset form?") == true) {
document.getElementById("frmInvitation").reset();
}
}
</script>