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

PREVIOUS NEXT
Code Example
Javascript :: session storage 
Javascript :: async function fetchJson 
Javascript :: random id generator 
Javascript :: expressjs create encrypted password 
Javascript :: Javascript function to get the difference between two numbers 
Javascript :: multer file type validation 
Javascript :: get first 10 items of array javascript 
Javascript :: react native display inline block 
Javascript :: add a route to a buttoin in angular 
Javascript :: javascript search on docuemt for text on iframe 
Javascript :: how to generate a fibonacci sequence in javascript 
Javascript :: discord.js v13 finish music play 
Javascript :: js shuffle array 
Javascript :: delete cr 
Javascript :: element is hidden jquery 
Javascript :: how to convert a string of numbers into an array javascript 
Javascript :: how to clean modal on js in event hide 
Javascript :: how to validate file extension in javascript 
Javascript :: javascript queryselector data attribute 
Javascript :: get value of input react 
Javascript :: eslint allow debugger 
Javascript :: nestjs create controller with cmd 
Javascript :: onclick css display jquery 
Javascript :: replacing characters in string javascript 
Javascript :: sequelize pagination postgres 
Javascript :: array of objects sahould have unique values 
Javascript :: data binding on checkbox angular 
Javascript :: keydown jquery 
Javascript :: moment format 23 hour 
Javascript :: js how to know the laster number of a number 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =