Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js form submit listener

document.getElementById("#myFormId").addEventListener("submit", function(e){
    if(!isValid){
        e.preventDefault();    //stop form from submitting
    }
  	//do whatever an submit the form
});
 
PREVIOUS NEXT
Tagged: #js #form #submit #listener
ADD COMMENT
Topic
Name
7+8 =