Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #7580
| From | Jason C <jwcarlton@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | onKeyUp when selecting from autocomplete |
| Date | 2011-10-19 18:35 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <21118012.96.1319074503372.JavaMail.geo-discussion-forums@yqp37> (permalink) |
I'm changing a DIV area as the site visitor types into an input field, like this:
<input type="text" name="title" size="20"
onKeyUp="
document.getElementById('title').innerHTML =
document.admanager.title.value
">
This works fine if they are actually typing, but the problem I'm having is if they're typing and select something from their browser's autocomplete. If they select it using an arrow and carriage return, then it still works, but if they select with their mouse then it doesn't.
Is there an event that runs on key press OR mouse selection, or am I going to have to duplicate it like this? (untested):
<input type="text" name="title" size="20"
onKeyUp="
document.getElementById('title').innerHTML =
document.admanager.title.value
"
onChange="
document.getElementById('title').innerHTML =
document.admanager.title.value
"
>
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar
onKeyUp when selecting from autocomplete Jason C <jwcarlton@gmail.com> - 2011-10-19 18:35 -0700 Re: onKeyUp when selecting from autocomplete Antony Scriven <adscriven@gmail.com> - 2011-10-20 16:13 -0700 Re: onKeyUp when selecting from autocomplete dhtml <dhtmlkitchen@gmail.com> - 2011-10-20 21:23 -0700
csiph-web