I'm using onKeyUp to trigger javascript code after each key is pressed in an input field. However i have a color picker that fills that fills the field with a value when that color is picked.
Doing it that way, neither onKeyUp or onChange triggers the javascript. Is there perhaps another event handler I am looking for?
onChange help
Moderator: General Moderators
onChange help
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Well i want to fire it after the javascript has modified the value of the field. Which is where i thought onChange would come in.
Hmm. I think i could try giving the field focus after it has been modified. Then use onFocus to fire it.
Hmm. I think i could try giving the field focus after it has been modified. Then use onFocus to fire it.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Well, that worked. But now onKeyUp doesn't want to fire.
Is there a way to fire them when either happens?
I want to submit the form after any key is pressed, or after focus.
Code: Select all
<input type="text" name="pageBackgroundColor" size="15" onFocus="document.forms[0].submit();" onKeyUp="document.forms[0].submit();">I want to submit the form after any key is pressed, or after focus.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
There is no "onKeyUp" event in HTML. There is however an "onkeyup" event.
http://www.w3.org/TR/html4/interact/scr ... l#h-18.2.3
It is case sensitive when within the HTML itself. This however may or may not effect such a low level of HTML as you're not using XHTML (your input was not closed).
Best of luck!
http://www.w3.org/TR/html4/interact/scr ... l#h-18.2.3
It is case sensitive when within the HTML itself. This however may or may not effect such a low level of HTML as you're not using XHTML (your input was not closed).
Best of luck!