Example Name: Notes The first text box has no event handling attached. The form does not want to be submitted. The form does not want to be reset.
Code function $(id) { return document.getElementById(id); } window.onload = function() { $('frm').addEventListener("reset", function(e) { alert("Good idea. Too bad I'm not going to do it."); e.preventDefault(); }, true); $('frm').addEventListener("submit", function(e) { alert("Sorry, I can't submit the form Dave."); e.preventDefault(); }, true); };