Solved

combo onChange value load image

Posted on 2003-12-06
4
1,409 Views
Last Modified: 2008-03-04
Hello, i have a combo with image names i want to display the selected image from combo in some specific area inside html page. i want it with onChange event on combo.No Button. and combo should always be available for image change.
0
Comment
Question by:zahidrahim
4 Comments
 
LVL 32

Accepted Solution

by:
Batalf earned 25 total points
ID: 9888309
<img src="default.gif" id="myImage" name="myImage">
<select onchange="documenmyImage.src=this.options[this.selectedIndex].value">
<option value="image1.gif">Image 1</option>
<option value="image2.gif">Image 2</option>
</select>
0
 
LVL 75

Assisted Solution

by:Michel Plungjan
Michel Plungjan earned 25 total points
ID: 9888466
a few spelling mistakes and the possibility to choose the first image in the drop down:

<img src="default.gif" name="myImage">
<select onchange="document.myImage.src=this.options[this.selectedIndex].value">
<option value="default.gif">Please select</option>
<option value="image1.gif">Image 1</option>
<option value="image2.gif">Image 2</option>
</select>
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10394819
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: Batalf {http:#9888309} & mplungjan {http:#9888466}

Please leave any comments here within the next four days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jAy
EE Cleanup Volunteer
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question