473,397 Members | 1,961 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,397 software developers and data experts.

Catch key press at page level

Is there a way that I can catch the key press at page (form) level? I
have a page with about 15 controls. but there is only one submit
button. I want to do form submit when user press the enter button.

thanks

Nov 19 '05 #1
1 2823
Hi,

In the body tag of your page add this:

onkeypress="CheckLoginSubmit();"

Then put this in the <head> section of your page:

<script language="javascript">
function CheckLoginSubmit() {
if (event.keyCode == 13) {
document.getElementById("btnLogin").focus();
}
}
</script>

Now, when the Enter key is hit it will switch focus to the button and cause
a submit. Good luck! Ken.

--
Ken Dopierala Jr.
For great ASP.Net web hosting try:
http://www.webhost4life.com/default.asp?refid=Spinlight
If you sign up under me and need help, email me.

"Jinsong" <ji*****@mssolution.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
Is there a way that I can catch the key press at page (form) level? I
have a page with about 15 controls. but there is only one submit
button. I want to do form submit when user press the enter button.

thanks

Nov 19 '05 #2

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

Similar topics

6
by: José Joye | last post by:
Hello, I'm currently reading the MS Developing Web applications with c# (and VB.net). In the chapter related to Error management, there is a sample about "Page-Level Error Pages" eg: In my...
2
by: rranveer | last post by:
I've been searching for ways to perform custom error handling in an asp ..net web application and have found two ways of doing it: Page Level and Application Level. What I'm curious about is,...
3
by: Joe | last post by:
Hello all: From what I understand the ItemCommand, UpdateCommand, SortCommand, etc events for the datagrid require that the datagrid's enableVireState property is set to true. Does the...
2
by: Matt | last post by:
I have below sitemap as source for treeview that sits on master pages.. Is there a way to limit source for treeview to page level.. When i cruise the pages i would like to see only related nodes...
2
by: Corey B | last post by:
Is there a way for an instance of a custom class to access an ASPX page level variable? I know that I can access a Session variable from within a class using the following code: myClassVar =...
5
by: Andreas Bergmeier | last post by:
Hi. Does anybody know whether html rendering is available on page level? I know the xhtmlConformance setting in the web.config - but I'd like such a configurability on page level because I have...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi, Why doesn’t this property work at the Page level after postback; public virtual string SomePageProperty { get { string s = (string) ViewState; return ((s == null) ? String.Empty : s);
3
by: hardieca | last post by:
Hi, I've created an n-tier app where validation rules reside in the business layer. When a webform is saved, a business object examines its state, and if some property is invalid, throws a...
0
by: =?Utf-8?B?UGF1bA==?= | last post by:
I know that you can implement Page-Level Transactions on each page in the <@ page tag. Do you know if you can implement page-level transactions across the application in the web.config file? ...
0
by: rebuild | last post by:
Hi Experts, There is a property of TextBox field AutoCompleteType, if set to disabled it wont give browser cached options while typing text in the textbox. Can i set this property for all the...
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...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.