473,387 Members | 1,464 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,387 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 1721
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...

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.