1. document.getElementById("form").onsubmit=formHandler; 2. <form onsubmit="return formHandler();"></from>