onkeypress form attribute only firing once

Newbie Member
18Aug2008,10:47   #1
dnewbury's Avatar
I want to do realtime form validation. I have a form input tag with the onkeypress attribute. Like this onkeypress="isNewName();" It appears to call the isNewName function, but it seems to be only firing once. How can I make fire with each keystroke entered? Thanks for your help!
dan
Ambitious contributor
9Sep2008,04:15   #2
oogabooga's Avatar
This seems to fire every keypress. It displays the keycode in the status bar.
If your code still doesn't work, you'll have to post it.
Code:
<script>
function showKey() {
    window.status = event.keyCode;
}
</script>
<input size=10 onkeypress=showKey()>
Go4Expert Member
1Mar2009,07:20   #3
Ryzer's Avatar
onkeyup rather than onkeypress should work for realtime form validating