In an application I am creating, I do validation, filtering and ajax saving of values when the user changes something in a textbox.
A problem arrises if the user makes some changes, and then presses the Esc key 2 times. This causes the form to reset, but it skips all my validation and auto-saving logic.
To prevent this, you can use this little snippet of jQuery javascript:
$(document).ready(
function() {
// prevent the esc key from resetting all the textboxes
$("form").bind("reset", function(e) {
e.preventDefault();
});
}
);