Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

JQuery - Prevent enter key from submitting Form

I have a form.  Looking for a JQuery ONLY way of preventing the form from submitting when the ENTER key is hit.

Please - not looking for basic Javascript.
0
carsRST
Asked:
carsRST
  • 2
1 Solution
 
leakim971PluritechnicianCommented:
$(document).ready(function() {
		$(document).keypress(function(e) {
			if(e.keyCode == 13) e.preventDefault();
		})
});

Open in new window

0
 
carsRSTAuthor Commented:
Thanks, Professor leakim971!


You need secret service protection.  You're a huge asset, man.
0
 
leakim971PluritechnicianCommented:
lol
thanks for the points, have a nice week
see you soon
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now