Stop "Enter" press on form JQuery

jQuery is a fast, small, and feature-rich JavaScript library. It makes things like HTML document traversal and manipulation, event handling, animation, and Ajax much simpler with an easy-to-use API that works across a multitude of browsers. With a combination of versatility and extensibility, jQuery has changed the way that millions of people write JavaScript.
Post Reply
dzcadii
Posts: 94
Joined: Sun Mar 01, 2015 4:36 am

Stop "Enter" press on form JQuery

Post by dzcadii » Sat Jun 06, 2015 1:27 am

Simply put:

Code: Select all

$('form :input').on("keypress", function(e) {
    return e.keyCode != 13;
});

Post Reply