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

R

Rob Nicholson

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.
 
M

Marina

what about the event for when text changes, I think 'onchange' or
'ontextchange' or something like that
 
G

Guest

Rob Nicholson said:
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>
 
R

Rob Nicholson

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.
 
R

Rob Nicholson

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.
 
R

Rob Nicholson

OnKeyPress

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

Thanks, Rob.
 
B

Bob Barrows [MVP]

Rob said:
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.
 
S

Steven Cheng[MSFT]

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]" <[email protected]>
| References: <[email protected]>
<OnRvI7#[email protected]>
| 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: <[email protected]>
| Newsgroups:
microsoft.public.dotnet.framework.aspnet,microsoft.public.dotnet.languages.j
script,microsoft.public.inetsdk.programming.scripting.jscript
| NNTP-Posting-Host: 66-189-67-134.dhcp.oxfr.ma.charter.com 66.189.67.134
| Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP15.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.languages.jscript:1344
microsoft.public.inetsdk.programming.scripting.jscript: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"
|
|
|
 
R

Rob Nicholson

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.
 
R

Rob Nicholson

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.
 
S

Steven Cheng[MSFT]

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" <[email protected]>
| References: <[email protected]>
<OnRvI7#[email protected]>
<[email protected]>
<[email protected]>
| 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: <[email protected]>
| 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!TK2MSFTNGP08.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.
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top