Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

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

You are here: irt.org | FAQ | JavaScript | Image | Q1469 [ previous next ]

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.

©2018 Martin Webb