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

"onkeypress" event


We are using the "onkeypress" event in Javascript to determine when
the user hits a particular key. This works well unless an ASP.NET
control (such as a textbox) has focus. In this case the onkeypress
event does not fire. Unfortunately, our need is to handle key presses
when a control does have focus, so we are kind of stuck right now.

My question is are we approaching this in the correct way? Is there
a better way to do this?
Oct 28 '05 #1
1 1722
You might not be passing the correct ID to the client-side script.
Peter Blum helped bring this to my attention in this forum topic [1] when I
had problems with similar events.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://forums.asp.net/1089636/ShowPost.aspx
"Mike Moore" <Mi*******@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...

We are using the "onkeypress" event in Javascript to determine when
the user hits a particular key. This works well unless an ASP.NET
control (such as a textbox) has focus. In this case the onkeypress
event does not fire. Unfortunately, our need is to handle key presses
when a control does have focus, so we are kind of stuck right now.

My question is are we approaching this in the correct way? Is there
a better way to do this?

Oct 29 '05 #2

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

Similar topics

5
by: http://links.i6networks.com | last post by:
I want to force the users to click submit to submit the forms. How do I disable "Enter Key" which will submit the form automatically when they entered the data in text field then pressed "enter key"
6
by: Paul Turley | last post by:
Does anyone have some sample script to "press" a button or image button when the user presses the Enter key? I see this behavior on a lot of web pages but I'm not finding any samples. Thx --...
2
by: Cindy | last post by:
Hi all you smarties out there, I'm having a little conundrum with my asp.net page Scenario: I have a form (asp.net) with no code behind (as yet). I have placed a javascript function on a...
3
by: dhnriverside | last post by:
Hi I've got the following in my aspx <asp:textbox id="findwhat" OnKeyPress="javascript:suggest()"></asp:textbox> and the suggest function function suggest() {
1
by: Mike Moore | last post by:
We are using the "onkeypress" event in Javascript to determine when the user hits a particular key. This works well unless an ASP.NET control (such as a textbox) has focus. In this case the...
3
by: Robert Inder | last post by:
I am struggling to catch kestrokes within an Internet Explorer 6 window. My window happens to be displaying three frames, though I suspect a similar problem would arise with a single document. ...
3
by: Crash_beta | last post by:
Let me show u what I have,, I need to make this work with comma's in the numbers like 123,000.45 Not just 123000.45 <script type="text/javascript"> <!-- Begin
2
by: mattgarvin | last post by:
Hello, I need a piece of javascript that will allow a form to be submitted when Enter is pressed for IE6 and 7, Firefox 2, and recent versions of Safari. It is for a login page that has two...
7
by: dennis.sprengers | last post by:
I am trying to write an editor object, which adds some functionality and a toolbar to every textarea with a "form-textarea" class. Both FF and IE generate an error in line 20...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.