TeamPhotoshop
Reviews, updates and in depth guides to your favourite mobile games - AppGamer.com
Forum Home Latest Posts Search Help Subscribe

Drop-down menus and JavaScript

Page: 1 Reply
Aug 30th 2001#14930 Report
Member since: Jun 30th 2001
Posts: 447
I have a drop-down menu in the shape of a form and an image dubbed preview:
[code]
<form name=mediaForm>
<select name=mediaID>
<option value="1.jpg">1.jpg</option>
<option value="2.jpg">2.jpg</option>
... etc. ...
</select>
<br>
<img name=preview src=preview.gif>
[/code]

What I want to happen is have JavaScript swap the preview.gif with the image the user selects from the drop-down menu based on the value of that option.

I've tried adding an onSelect="javascript:document.preview.src='images/whatever.jpg'" to each option tag. This is really no problem as the menu is PHP generated, but I can't get it to work without an error in the browser. Any ideas...

P.S. The space between java & script shouldn't exist. It should read javascript.
Reply with Quote Reply
Aug 31st 2001#14979 Report
Member since: Jun 30th 2001
Posts: 447
I figured it out finally!
Reply with Quote Reply
Page: 1 Back to top
Please login or register above to post in this forum