Posts: 252
Location: Auckland, New Zealand
|
Chroder's method is probably the better way than trying to override an event, especially when those events should be read-only it's just IE seems to think they can be overriden.
Although you could use onkeyup or onblur, I would prefer changing it when focus is lost (onblur) than calling it on each keyup.
Shouldn't really matter, because your script that handles the form should convert it to uppercase anyways instead of relying on the input to be uppercase.
If you want to capture characters a more compatible way then:
Code:
var ch = (event.keyCode) ? event.keyCode : event.charCode;
event.which is a real old method which was used in Netscape and does work in Firefox, but I find charCode more compatible for all other browsers, keyCode is IE specific but a few browsers may support it too.
Events should be read-only, so you can't override them, just seems Firefox has kept it that way.
Cheers,
MC
__________________
#------------------------------ signature---------------------------------------------------------------------------------#
Quote:
|
I am well recognised for what I don't do than what I do. Chores are just one of those things.
|
Last edited by mastercomputers : 06-10-2006 at 10:47 PM.
|