Help - Search - Members - Calendar
Full Version: Which events are called?
HTMLHelp Forums > Programming > Client-side Scripting
I want to show a picture when an entry in a select box an entry is selected. It should be shown immediately as it is meant as a help for people to choose the right option. So I need to know which events are generated that I can use.

The selected box has multiple rows (size=4).

Can someone help me with this information?
onchange for the SELECT. The value for SELECT is the value of the chosen option.

function getOption(x)

<select onchange="getOption(this.value);">
<option selected>Choose a Pet</option>
<option value="dog">Dog</option>
<option value="cat">Cat</option>
<option value="parrot">Parrot</option>

Note that the returned value is that of the value attribute, not what's visible on the page. So if the first option is chosen 'dog' not 'Dog' will be returned.
Thank you.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2021 Invision Power Services, Inc.