Posted By

smithbjames on 07/24/10


Tagged

form javascript textmate jquery


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

rageit


Prevent Enter from Submitting Form (jQuery)


 / Published in: jQuery
 

  1. $('.no-enter').keypress(function(e){ //Stop form fields with class 'no-enter' from submitting the form when the user presses enter
  2. if(e.which == 13){ //Identifies the enter key as the key pressed
  3. e.preventDefault(); //Stops the enter key from performing default function
  4. alert('no enter'); //Put whatever you want to happen here
  5. }
  6. });

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: on January 22, 2019

download best software to android root use app kingo or 360 for pc mac ios windows 10 8 1 7 xp computer nycweixin

You need to login to post a comment.