Skip to content

Instantly share code, notes, and snippets.

@saji89
Created October 21, 2013 05:51
Show Gist options
  • Save saji89/7079230 to your computer and use it in GitHub Desktop.
Save saji89/7079230 to your computer and use it in GitHub Desktop.
Calling a function after the form reset event. Courtesy: http://stackoverflow.com/a/12178710/749232 The regular reset event of a form fires as and when the reset is clicked, and we do not get the state after the form reset. For getting that state we can use this code.
$(document).ready(function() {
$("input:reset").click(function() { // apply to reset button's click event
this.form.reset(); // reset the form
// call your functions to be executed after the reset
return false; // prevent reset button from resetting again
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment