473,786 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.Attri butes("onkeyup" ) = "ChangeTitle(); "
FirstName.Attri butes("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 1920
what about the event for when text changes, I think 'onchange' or
'ontextchange' or something like that

"Rob Nicholson" <in******@commu nity.nospam> wrote in message
news:OJ******** ******@TK2MSFTN GP15.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.Attri butes("onkeyup" ) = "ChangeTitle(); "
FirstName.Attri butes("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.Attri butes("onkeyup" ) = "ChangeTitle(); "
FirstName.Attri butes("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.fromChar Code(event.keyC ode);
}
</SCRIPT>
<table>
<tr>
<td>First Name</td>
<td>
<INPUT ID="oFirstName " TYPE="text" onKeyPress="fnK eyPress();">
</td>
<td>
Copy of First Name
</td>
<td>
<INPUT ID="oFirstNameC opy" 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.Attri butes("onkeyup" ) = "ChangeTitle(); "
FirstName.Attri butes("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******@NOyah oo.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.publi c.dotnet.framew ork.aspnet,micr osoft.public.do tnet.languages. j
script,microsof t.public.inetsd k.programming.s cripting.jscrip t
| NNTP-Posting-Host: 66-189-67-134.dhcp.oxfr.m a.charter.com 66.189.67.134
| Path: TK2MSFTNGXA01.p hx.gbl!TK2MSFTN GP08.phx.gbl!TK 2MSFTNGP15.phx. gbl
| Xref: TK2MSFTNGXA01.p hx.gbl
microsoft.publi c.dotnet.langua ges.jscript:134 4
microsoft.publi c.inetsdk.progr amming.scriptin g.jscript:1077
microsoft.publi c.dotnet.framew ork.aspnet:1190 06
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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

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

Similar topics

1
3295
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 click on FormB, then back to FormA although the cursor is still flashing in the same textbox on FormA, when I tab out, the 'Leave' event for that TextBox does not fire. If I stay on FormA and Shift-Tab back into the textbox then the 'Enter' event...
1
11586
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 http://weblogs.asp.net/asmith/archive/2003/09/15/27684.aspx but it was far more complex then I needed. (I got lost trying to figure it all out). Therefore, here goes my simple "web dialog box with parent event handler fireing" solution. ...
5
23040
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 called when I hit the 'Enter' key. After typing in letters in the textbox, if I hit the 'Tab' key or click outside the text box with my mouse, the event fires. Here's the code: <form id="frmArticle" name="frmArticle" method="post" runat="server">
9
2230
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) in page_load, or elsewhere, that says page.validate, no control says "causesvalidation=true", and the AutoEventWireup is set to false. So I would think that the control's server event function would NOT execute, but it does execute right after...
1
3868
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 using a GridView that has ViewState enabled, an ObjectDataSource to process the submitted list, textboxes for getting new item data and an add button. Does this approach sound feasible or are there better alternatives? My problem is that I don't...
2
2161
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 ----------------------- I have an mdi parent form.
14
14635
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 presses the "Save" button while the textbox has the focus, the LostFocus code doesn't run at the right time, so that the "Save" function is dealing with an incorrectly formatted string and the whole caboodle goes splat.
0
2478
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" runat="server" DataSourceID="SqlDataSource1" DataKeyNames="UserKey" AllowSorting="True" HeaderStyle-Height="24px" AutoGenerateColumns="false" SkinID="Grey3" EditRowStyle-CssClass="dgedit"
11
14830
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 processed by the web server. I am still struggling to understand this postback logic, and hope that some kind gurus out there could help me clarify the confusion I have.
0
9496
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7512
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.