• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 129
  • Last Modified:

enter in jquery

Hello guys

I have a table with 20 rows, each row has a field that I insert a value.
When I insert a value into the field, I only update my table when the field is left.
I want to work with enter, when I click enter I want to focus a button.

How can I do this?
  • 2
1 Solution
Check below example
<meta http-equiv="Content-Language" content="en-gb">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Kiran Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js" type="text/javascript"></script>

     $("input").keypress(function (e) { 
        if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
            return false;
        } else {
            return true;


  <form action="http://www.google.com" method="get">
<input type="text" id="email"> <br />
<input type="text" id="name">
<input type="submit" id="1email" class="default">


Open in new window

hidrauAuthor Commented:
thanks very much
hidrauAuthor Commented:

Featured Post

[Webinar On Demand] 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