Search
 
SCRIPT & CODE EXAMPLE
 

CSS

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
Css :: remove hover effect css 
Css :: how to align elements horizontally in css 
Css :: underline height 
Css :: how to create a strikethrough in css 
Css :: css div fill whole page 
Css :: transition all ease 0.3s 
Css :: css disable selection 
Css :: css resize image without distortion 
Css :: color code for pink 
Css :: edge media query 
Css :: random color scss 
Css :: css set width of a span 
Css :: change scrollbar width and height in css 
Css :: hidden div css 
Css :: How to make an image fill its container without stretching 
Css :: css input selector 
Css :: text color as gradient css 
Css :: how to align divs in a row 
Css :: how to center divs in css 
Css :: remove outline of input css 
Css :: css border top 
Css :: tailwind input field hide arrows 
Css :: calc(100vh - px) 
Css :: radio button color css 
Css :: how to specify css for smaller screen 
Css :: header center 
Css :: resize image slowly on hover 
Css :: box shadow transperent 
Css :: background color transparent 
Css :: how to position something on the same line css 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =