Created
October 21, 2013 05:51
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(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