Re: JavaScript, Detecting KeyUp or KeyDown KeyCode

  • From: "Bryan Garaventa" <bgaraventa11@xxxxxxxxxxxxxx>
  • To: <programmingblind@xxxxxxxxxxxxx>
  • Date: Fri, 24 Jul 2009 11:37:10 -0700

  Sorry, I'm coming into this thread somewhat late.

  I've seen this implementation before, and it is effective. There is one 
situation you might want to code for though...

  When the onchange triggers the alert, this occurs regardless whether you are 
typing or deleting. This gets pretty annoying when you keep hitting backspace 
and the dialog keeps popping up anyway. So you may wish to code the onchange 
handler to evaluate whether the length value is less than or greater than the 
prior value, which will let you know whether someone is typing or deleting. 

  I know what the next question is, if the onchange occurs when typing, then 
hitting one backspace should do the trick right? 

  Not so when pasting... This can sometimes bypass the allowed character amount 
by quite a bit. 

  ----- Original Message ----- 
  From: RicksPlace 
  To: programmingblind@xxxxxxxxxxxxx 
  Sent: Thursday, July 23, 2009 7:36 AM
  Subject: Re: JavaScript, Detecting KeyUp or KeyDown KeyCode

  Hi: ARIA is out for now. I don't know anything about it and just want to get 
this bloody thing working properly with basic methods everyone understands at 
  It will do a popup if you exceed the max. You can left mouse click the 
TextBox and hear how many characters you have typed and the Max number allowed. 
Putting a label under the textbox with a real-time value would just mean 
dropping a label on the form and either loading the value in the same script 
where I check for the text Overflow.
  I am not going to do that because it is useless to a screen reader user until 
they tab out of the box and would only be really effective for sighted folks.
  The idea of the noisy region holds promise but I don't think as a container 
for a running real-time value that changes while you type every letter. You 
might hear a 0 b 1 x 3 ... l 1942 m 1943 etc... if the value of the label 
changed for each letter entered and the region were read because of the updated 
count. Anyway, displaying a running count in a label is pretty easy and the 
alert popup and the hot key popup are about ready to implement.
  Rick USA

Other related posts: