473,396 Members | 2,018 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.

What event fires when user uses Alt & numeric key pad to enter text into a textbox

In our application, we've added a bit of JavaScript that updates a title as
the user types into a textbox. To trigger this, we patch into the "onkeyup"
and "onpaste" events:

FirstName.Attributes("onkeyup") = "ChangeTitle();"
FirstName.Attributes("onpaste") = "ChangeTitle();"

This works a treat but neither of these events fire if the user happens to
enter a foreign character using the standard Windows ALT key plus numberic
keypad, e.g. Alt-0225 generates "á".

Anyone got any idea which, if, any event to handle for this situation?

Thanks, Rob.
Nov 19 '05 #1
10 1881
what about the event for when text changes, I think 'onchange' or
'ontextchange' or something like that

"Rob Nicholson" <in******@community.nospam> wrote in message
news:OJ**************@TK2MSFTNGP15.phx.gbl...
In our application, we've added a bit of JavaScript that updates a title
as
the user types into a textbox. To trigger this, we patch into the
"onkeyup"
and "onpaste" events:

FirstName.Attributes("onkeyup") = "ChangeTitle();"
FirstName.Attributes("onpaste") = "ChangeTitle();"

This works a treat but neither of these events fire if the user happens to
enter a foreign character using the standard Windows ALT key plus numberic
keypad, e.g. Alt-0225 generates "á".

Anyone got any idea which, if, any event to handle for this situation?

Thanks, Rob.

Nov 19 '05 #2

"Rob Nicholson" wrote:
In our application, we've added a bit of JavaScript that updates a title as
the user types into a textbox. To trigger this, we patch into the "onkeyup"
and "onpaste" events:

FirstName.Attributes("onkeyup") = "ChangeTitle();"
FirstName.Attributes("onpaste") = "ChangeTitle();"

This works a treat but neither of these events fire if the user happens to
enter a foreign character using the standard Windows ALT key plus numberic
keypad, e.g. Alt-0225 generates "á".

Anyone got any idea which, if, any event to handle for this situation?


OnKeyPress

<html><body>
<SCRIPT>
function fnKeyPress()
{
oFirstNameCopy.value += String.fromCharCode(event.keyCode);
}
</SCRIPT>
<table>
<tr>
<td>First Name</td>
<td>
<INPUT ID="oFirstName" TYPE="text" onKeyPress="fnKeyPress();">
</td>
<td>
Copy of First Name
</td>
<td>
<INPUT ID="oFirstNameCopy" TYPE="text" >
</td>
</tr>
</table>
</body>
</html>

--
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
Nov 19 '05 #3
> In our application, we've added a bit of JavaScript that updates a title
as
the user types into a textbox. To trigger this, we patch into the "onkeyup" and "onpaste" events:

FirstName.Attributes("onkeyup") = "ChangeTitle();"
FirstName.Attributes("onpaste") = "ChangeTitle();"

This works a treat but neither of these events fire if the user happens to
enter a foreign character using the standard Windows ALT key plus numberic
keypad, e.g. Alt-0225 generates "á".

Anyone got any idea which, if, any event to handle for this situation?


This was posted with a MSDN friendly email address - isn't somebody from
Microsoft supposed to comment?

Thanks, Rob.
Nov 19 '05 #4
> what about the event for when text changes, I think 'onchange' or
'ontextchange' or something like that


onchange will fire but only when the text box looses focus. However, I think
this will have to be a workaround for now.

Thanks, Rob.
Nov 19 '05 #5
> OnKeyPress

Are you Bobby Moore? :-) I'll check - we're handling onkeyup but will try
onkeypress.

Thanks, Rob.
Nov 19 '05 #6
Rob Nicholson wrote:

This was posted with a MSDN friendly email address - isn't somebody
from Microsoft supposed to comment?

I think they only comment when the post has not received a useful reply.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Nov 19 '05 #7
Hi Rob,

Frankly speaking, I think other community members' suggestion has been very
complete. For the Alt- number scenario, neither keydown or keyup(keypress)
will work. Currently the only workaround is the "onchange" event though it
only fire when the focus leave the entry field. Seems we are limited to
these clientside events now.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Bob Barrows [MVP]" <re******@NOyahoo.SPAMcom>
| References: <OJ**************@TK2MSFTNGP15.phx.gbl>
<On**************@tk2msftngp13.phx.gbl>
| Subject: Re: What event fires when user uses Alt & numeric key pad to
enter text into a textbox
| Date: Thu, 18 Aug 2005 18:50:21 -0400
| Lines: 14
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2900.2670
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670
| X-RFC2646: Format=Flowed; Original
| Message-ID: <OW*************@TK2MSFTNGP15.phx.gbl>
| Newsgroups:
microsoft.public.dotnet.framework.aspnet,microsoft .public.dotnet.languages.j
script,microsoft.public.inetsdk.programming.script ing.jscript
| NNTP-Posting-Host: 66-189-67-134.dhcp.oxfr.ma.charter.com 66.189.67.134
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFT NGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.jscript:1344
microsoft.public.inetsdk.programming.scripting.jsc ript:1077
microsoft.public.dotnet.framework.aspnet:119006
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| Rob Nicholson wrote:
| >
| > This was posted with a MSDN friendly email address - isn't somebody
| > from Microsoft supposed to comment?
| >
| I think they only comment when the post has not received a useful reply.
|
| --
| Microsoft MVP - ASP/ASP.NET
| Please reply to the newsgroup. This email account is my spam trap so I
| don't check it very often. If you must reply off-line, then remove the
| "NO SPAM"
|
|
|

Nov 19 '05 #8
> I think they only comment when the post has not received a useful reply.

Hmm :-) onkeypress doesn't trigger when ALT input option is used. We'll put
up with onchange firing when the user moves focus outside of the textbox.

Cheers, Rob.
Nov 19 '05 #9
> Frankly speaking, I think other community members' suggestion has been
very
complete. For the Alt- number scenario, neither keydown or keyup(keypress)


I'm just trying to understand what level of support I get via the newsgroups
as a MSDN subscriber. To be frank myself, the other community members could
have given completely false information :-) I realise they haven't in this
instance and that in a majority of time the answers are accurate and
informative. But I would have hoped for that clarification by a Microsoft
support person.

As an example, somebody could have said "if you use VB script instead, you
can capture this event". Sounds perfectly reasonable doesn't it.

I'm not trying to be awkward but this newsgroup is completely open and
therefore any "stamp of approval" via a Microsoft support person is
welcomed.

Cheers, Rob.
Nov 19 '05 #10
Thanks for your followup and the feedback,

Sure, we'll be willing to post our suggestions even if sometimes community
members have provided some general ideas. Anyway, I still think community
and MVP would be the main energy of newsgroup :-)

Thanks again for your posting.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "Rob Nicholson" <in******@community.nospam>
| References: <OJ**************@TK2MSFTNGP15.phx.gbl>
<On**************@tk2msftngp13.phx.gbl>
<OW*************@TK2MSFTNGP15.phx.gbl>
<mv*************@TK2MSFTNGXA01.phx.gbl>
| Subject: Re: What event fires when user uses Alt & numeric key pad to
enter text into a textbox
| Date: Mon, 22 Aug 2005 18:18:59 +0100
| Lines: 21
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.3790.181
| X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.3790.181
| Message-ID: <ed*************@TK2MSFTNGP14.phx.gbl>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: host217-45-2-106.in-addr.btopenworld.com 217.45.2.106
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA01.phx.gbl!TK2MSF TNGP08.phx.gbl!TK2MSFTNGP1
4.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:338925
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| > Frankly speaking, I think other community members' suggestion has been
| very
| > complete. For the Alt- number scenario, neither keydown or
keyup(keypress)
|
| I'm just trying to understand what level of support I get via the
newsgroups
| as a MSDN subscriber. To be frank myself, the other community members
could
| have given completely false information :-) I realise they haven't in this
| instance and that in a majority of time the answers are accurate and
| informative. But I would have hoped for that clarification by a Microsoft
| support person.
|
| As an example, somebody could have said "if you use VB script instead, you
| can capture this event". Sounds perfectly reasonable doesn't it.
|
| I'm not trying to be awkward but this newsgroup is completely open and
| therefore any "stamp of approval" via a Microsoft support person is
| welcomed.
|
| Cheers, Rob.
|
|
|

Nov 19 '05 #11

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

Similar topics

1
by: Chris Mayers | last post by:
Hi, I have an application that has (for the sake of argument) 2 (MDI) windows open. If I click into a textbox on FormA then the 'Enter' event for that TextBox fires, great! However, if I then...
1
by: Earl Teigrob | last post by:
I did a ton of searching to try and find a simple solution to this issue and finally wrote my own, which I am sharing with everyone. In my searching, I did find a very complete and robust solution at...
5
by: PD | last post by:
The TextChanged event is not being called when I hit the "Enter" key. Yet it does for the "Tab" key. I set a break point in the Page_Load event and the TextChanged event and none of these get...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
1
by: John_H | last post by:
Re: ASP.NET 2.0 I would like suggestions or code examples on how to collect a variable length list of input data (item# & item quantity specifically). I thought that I could accomplish this...
2
by: Lenster | last post by:
Environment --------------- Visual Studio.NET 2003 Version 7.1.3088 ..NET Framework 1.1 Version 1.1.4322 SP1 XP Professional 5.1.2600 SP2 Build 2600 Problem Description...
14
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user...
0
by: Mike P | last post by:
I am trying to edit a gridview while using paging, but whenever I try to edit a row on a page other than page 1, I get an error. Here is my gridview and my code : <asp:GridView ID="GridView1"...
11
by: antonyliu2002 | last post by:
I know that this has been asked and answered thousands of times. As a matter of fact, I know that I need to say If Not Page.IsPostBack Then 'Do something End If for things that needs to be...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.