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

enter key to submit textbox info

If there away where if a user types into my text box and hits enter i can add the data to my db just by the enter button so i don't need to use a button??
0
runnerjp2005
Asked:
runnerjp2005
1 Solution
 
Gurvinder Pal SinghCommented:
$("#id_of_textbox").keyup(function(event){
  if(event.keyCode == 13){
    //submit code
  }
});
0
 
CodeCruiserCommented:
You can also use a button and make it a default button so that pressing enter executes this button code

http://weblogs.asp.net/skoganti/archive/2004/09/20/231695.aspx

And another javascript technique

http://weblogs.asp.net/rajbk/archive/2003/12/11/setting-the-default-button-for-a-textbox-in-asp-net.aspx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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