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 :: vimscript replace function 
Javascript :: Adding Proof of Work to blockchain 
Javascript :: react native text input allow only numbers 
Javascript :: Sorting the Odd way! 
Javascript :: how to add random color in chart in react j 
Javascript :: javascript check if a number starts with another number 
Javascript :: ngx chart how to use in angular 
Javascript :: pass a react component as a prop from another component 
Javascript :: What Is A Closure: Informal Explanation 
Javascript :: css to jss 
Javascript :: Object.entries() For A JSON 
Javascript :: let result = 7 + 13 / 9 + 7; let result2 = 100 / 2 * 6; answer= result* result2; result = answer; final Result = result.toFixed(2); final Number = Number(final Result); console.log(finalNumber); 
Javascript :: Joi conditional validation refer parent object 
Javascript :: 2--Calculate power function: Given two integers k and n, write a function to compute k^n.. 
Javascript :: prisma bytes 
Javascript :: Enqueue jquery for TypeError: $.browser is undefined issue 
Javascript :: express dynamic api template 
Javascript :: required field in javascript dynamically 
Javascript :: angular service await for data 
Javascript :: angular file upload code anji 
Javascript :: Initialize View With Collection Backbone 
Javascript :: angular button click event 
Javascript :: object.map() nest js 
Javascript :: how to define class in javascript 
Javascript :: switch 
Javascript :: find all the prime numbers in the array 
Javascript :: react native get screen height and width 
Javascript :: user authentication and routing + nodejs + express 
Javascript :: regex concatenazione 
Javascript :: JavaScript Access Symbol Description 
ADD CONTENT
Topic
Content
Source link
Name
6+9 =