Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jQuery Prevent Submit on Enter Key Except in Textarea

$(document).ready(function () {
    $(window).keydown(function (event) {
        if ((event.keyCode == 13) && ($(event.target)[0] != $("textarea")[0])) {
            event.preventDefault();
            return false;
        }
    });
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: Could not resolve "i18n-iso-countries" 
Javascript :: Create & Download PDF from Byte[] Array using jQuery AJAX 
Javascript :: node rename 
Javascript :: use anchor element to open file 
Javascript :: alternative for react-tilt 
Javascript :: change rotation phaser 
Javascript :: Disemvowel Trolls 
Javascript :: phaser place on rectangle shift 
Javascript :: phaser add animation event 
Javascript :: phaser animation on repeat event 
Javascript :: get lat long react native 
Javascript :: Is he gonna survive 
Javascript :: npm deploy next js with tailwind 
Javascript :: hook use effect with class 
Javascript :: javascript concat two htmlcollection 
Javascript :: HDEL in redis 
Javascript :: javascript show alert if browser is not google chrome 
Javascript :: graphql nested schema 
Javascript :: javascript math round 
Javascript :: module.exports equivalent typescript 
Javascript :: what is local storage and session storage in javascript 
Javascript :: grid in js 
Javascript :: tofixed in javascript 
Javascript :: how to loop over dom objects javascript 
Javascript :: react native push notifications npm 
Javascript :: objects in array 
Javascript :: .unshift 
Javascript :: electron hot reload 
Javascript :: jquery sweet popup 
Javascript :: javascript array looping 
ADD CONTENT
Topic
Content
Source link
Name
6+6 =