Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q1469 How can I display a specific .gif or text message depending on the selected option of my dropdown list box in my form?

irt.org | Knowledge Base | JavaScript | Image | Q1469 [ previous next ]

Q1469 How can I display a specific .gif or text message depending on the selected option of my dropdown list box in my form?

Try:

<form>
<select onChange="if (document.images) document.images["theImage"].src = this.options[this.selectedIndex].value">
<option value="image1.gif">Image 1
<option value="image2.gif">Image 2
<option value="image3.gif">Image 3
</select>
</form>

<img name="theImage" src="blank.gif">

Note that all the images need to be the same size in Netscape.


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.