Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

submit on pressing enter key

Status
Not open for further replies.

jcbr

Programmer
Apr 19, 2001
12
US
Hello, I have an asp search page that contains several text fields, and upon user entry, submits the data to a db, and returns the results of that search. No big deal...however, I want to be able to have the form submit after I hit the enter key after entering info in any text box. Right now it will only do this when the very first text box has text entered and then the enter key is hit. I had to use 2 separate forms to get it to do this: One form contains the text box that will actually submit when the enter key is hit, the other form contains all the rest of the text boxes. I need to be able to submit when any text is entered in any box and the user hits enter. Any help is tremendously appreciated!
 
this is a normal behaviour : the enter key submit the forms you're on, not all the forms of a page !!!!
also, dependaing on which browser/version you use, sometimes any field will submit the form, some times only the last one will
if you really want to twist it so that it works,
- capture all key pressed in any part of the form
- detect which key was pressed and
- if it was enter, submit
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top