Answers for "js form submit listener"

5

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
});
Posted by: Guest on September-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language