all groups > dotnet jscript > august 2005 >
You're in the

dotnet jscript

group:

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


RE: What event fires when user uses Alt & numeric key pad to enter tex Phillip Williams
8/12/2005 12:48:03 PM
dotnet jscript:

[quoted text, click to view]

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

Re: What event fires when user uses Alt & numeric key pad to enter text into a textbox Marina
8/12/2005 2:35:32 PM
what about the event for when text changes, I think 'onchange' or
'ontextchange' or something like that

[quoted text, click to view]

What event fires when user uses Alt & numeric key pad to enter text into a textbox Rob Nicholson
8/12/2005 7:18:59 PM
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.

Re: What event fires when user uses Alt & numeric key pad to enter text into a textbox Rob Nicholson
8/18/2005 12:00:00 AM
[quoted text, click to view]

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

Thanks, Rob.

Re: What event fires when user uses Alt & numeric key pad to enter text into a textbox Rob Nicholson
8/18/2005 12:00:00 AM
[quoted text, click to view]

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.

Re: What event fires when user uses Alt & numeric key pad to enter tex Rob Nicholson
8/18/2005 12:00:00 AM
[quoted text, click to view]

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

Thanks, Rob.

Re: What event fires when user uses Alt & numeric key pad to enter text into a textbox Bob Barrows [MVP]
8/18/2005 6:50:21 PM
[quoted text, click to view]
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"

Re: What event fires when user uses Alt & numeric key pad to enter text into a textbox Rob Nicholson
8/22/2005 12:00:00 AM
[quoted text, click to view]

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.

AddThis Social Bookmark Button