PDA

View Full Version : sort of an onChange thing need help


zduck
09-19-2002, 08:11 PM
I need a way to submit a form everytime the user changes the contents of a textbox. with every keystroke the enter not just when the focus is off the the textbox. I tried using the onChange even to do this but it only fired the event when the focus left the textbox. I tried using the onkeypress but it was always one keystroke behind in submiting, ex. if the user enters 11 it will submit 1 or if the user enters 546 it will submit 54. Its never on track. Can I get some help with this? I have the same problem with a checkbox I need it to submit the form whenever someone checks/unchecks the box. Not just when the focus leaves the box.

Thanks for you help.
-Joshua Davd

ASAAKI
09-19-2002, 11:40 PM
did u try onkeyup and onkeydown for the textbox and onclick for the checkbox?

zduck
09-20-2002, 12:06 AM
thank you very much. that worked. I'm just starting to use javascript on my site so I'm still learning my way around.