onChage event realtime?

liunx

Guest
I want to do some validations and processing as the user enters characters into an input field (I'll probably use JavaScript), but I can't find the right event. The onChange event only fires when the user "commits" by submitting the form of when the input element loses the focus. How can I fire an event each time a character is entered into an input element? Thanks for the help!<!--content-->You'd need to process keyboard events (keydown, keyup, keypress). This can be a really bad idea, verging on harassement - it's much more typical to let the user (think:ME) enter the data, and then prompt for invalid entry. There are also some insertion point problems possible (*Netscape*) and the whole thing may not be worth it. What specifically is needed?<br />
<br />
btw, you don't 'fire an event' - the browser/OS does; you trap & process it...<!--content-->This is being used for barcode scanning, and "parsing" the data as it hits the text box...but, on second thought, you're probably right, I'll just validate when they finish entering data. Thanks for the help/opinion.<!--content-->Okay, I still need to do this. Is there any event that isn't keyboard related (because we're using a scan gun and barcodes) that will run when individual characters are entered into a text input? For example: I need to parse a barcode after the 11th character is entered, but the user should only interact with the scan gun, not the mouse or keyboard (for speed and ease of use issues. it's a manufacturing environment where speed is essential). Does this make sense?<!--content-->sorry, just realized that this is in the wrong forum, please ignore this thread<!--content-->
 
Back
Top