Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

prevent enter key submitting a form jquery

$('#formid').on('keyup keypress', function(e) {
  var keyCode = e.keyCode || e.which;
  if (keyCode === 13) { 
    e.preventDefault();
    return false;
  }
});
Comment

jquery avoid enter submit

$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
Comment

Jquery JavaScript Prevent From Press Enter Key Keyboard

//Use As Function
function stopEnter() {
    $("form").submit(function (e) {
        e.preventDefault();
    });
}
//Use As Regular
$(function () {
    $('form').submit(function (e) {
           e.preventDefault();
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: detect os javascript 
Javascript :: discord.js v13 ending play after 
Javascript :: jstl replace 
Javascript :: regex url 
Javascript :: check jquery version in chrome 
Javascript :: unsafe value used in a resource URL context 
Javascript :: string check javascript 
Javascript :: jquery show flex 
Javascript :: get last day of month javascript 
Javascript :: javascript json foreach value 
Javascript :: javascript remove from array by index 
Javascript :: create react native app 
Javascript :: js crpyto generate safe token 
Javascript :: express ejs 
Javascript :: window.location.href target blank 
Javascript :: validate aadhaar number in javascript 
Javascript :: convert stream to string javascript 
Javascript :: jquery post upload file 
Javascript :: get input value jquery 
Javascript :: specify parameter type in javascript vscode 
Javascript :: updating react version 
Javascript :: jquery get attribute value of parent element 
Javascript :: sanitise string js 
Javascript :: data binding on checkbox angular 
Javascript :: useHistory is not exported form react-router-dom 
Javascript :: js get alphabet as array 
Javascript :: styled components error in nextjs 
Javascript :: ionic 4 how to iterate json object in view 
Javascript :: how to check connected devices in react native 
Javascript :: js self executing anonymous function 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =