[thelist] Detecting certain keys input via JS

Jason Lustig jasonlustig at adelphia.net
Thu Jul 8 21:17:07 CDT 2004


Hi y'all

So I'm working on some more javascript UI stuff, and have been thinking 
a lot about password boxes.

I know that on Macs, if you hit backspace in a password box, it deletes 
everything in the box - presumably if you made a typo you should just 
start over.

I really like this functionality and want to give my password boxes it. 
I suppose I just need to set it up so that it's like:

<input type="password" name="foo" onchange="checkBackspace(this);"/>

... and just declare the function checkBackspace() to detect if a 
backspace was put in, and if so, clear this.value.

Any ideas on how to find out what the character input was?

Thanks!

Jason


More information about the thelist mailing list