Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

submit form on ctrl enter

form.addEventListener("keydown", (event) => {
  if ((event.keyCode == 10 || event.keyCode == 13) && event.ctrlKey) {
    if (validateForm()) { // validation refer to if user's enter data is correct or not
      alert("ALL fields are filled");
    }
    alert("Looks like you have not filled the form");
  }
});
 
PREVIOUS NEXT
Tagged: #submit #form #ctrl #enter
ADD COMMENT
Topic
Name
1+2 =