473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Return Key Press

I have a web form that has an OK button. I would like the
user to be able to press the return key to activate the OK
button as well as clicking on the button. How would I do
this?

Thanks for any help.
Nov 18 '05 #1
1 1100
You can intercept the client side enter keypress event of the text box and
then click the correct button using javascript code.
Here's a good example:
http://www.kamp-hansen.dk/pages/show...d=21&menuid=18

You could also try using this free control.
http://www.metabuilders.com/tools/DefaultButtons.aspx

And here's a good article on the subject:
http://www.allasp.net/enterkey.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"Tracey" <an*******@discussions.microsoft.com> wrote in message
news:02****************************@phx.gbl...
I have a web form that has an OK button. I would like the
user to be able to press the return key to activate the OK
button as well as clicking on the button. How would I do
this?

Thanks for any help.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: ~Gee | last post by:
Hi Folks! Please see the program below: 1 #include<iostream> 2 #include<list> 3 #include <unistd.h> 4 using namespace std; 5 int main() 6 { 7 {
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
3
by: Dan | last post by:
Consider a simple form with a textbox and button. Is there a way to handle the common situation where a user presses "return" rather than clicks on the button. I can already detect the...
1
by: Steve Bywaters | last post by:
I'm attempting to do a lookup, using a javascript-launched child window to enable the user to select a value, then return that value to the parent/launching window. Pictures... to demonstrate...
18
by: Seeker | last post by:
I essentially copied this program from K&R: #include <stdio.h> #include <stdlib.h> int main() { int c;
2
by: veronicab | last post by:
Hi, I have a small JavaScript code in a page to trap when user presses Return key. My problem is that if you visit the page and then enter a different url in address field, and press Return,...
0
by: petr | last post by:
Hello Forum, I work under linux kernel 2.6.20-1.2320.fc5 I wrote an awk script (named prim_fail) for generating a sequence of draws from a binomial distribution: BEGIN { srand() } {...
3
by: King Coffee | last post by:
Hi, I have an asp:hyerLink control followed by an asp:Login control. If I inadvertently press the return key while within the login control... the asp.net page will perform the hyperlink and...
7
by: satyabhaskar | last post by:
hi all, In my web page i have 3 text boxes and one submit button...Actually my problem is how do i focus on 2nd text box upon (pressing enter key)carriage return press in the first text box...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.