Skip navigation
Currently Being Moderated

PHP - show image next to <option>

Mar 19, 2013 2:35 AM

Is it possible via javascript/jQuery to select an image option (see below) and then have the image associated with the <option> show next to the <select> tag?

 

<select name="images" id="images">

<option>Select Image</option>

<option value="one.jpg">one.jpg</option>

<option value="two.jpg">two.jpg</option>

<option value="three.jpg">three.jpg</option>

<option value="four.jpg">four.jpg</option>

<option value="five".jpg>five.jpg</option>

</select>

 

<img src="http://www.DomainName/imageOptions/nameOfImage.jpg" width="200" height="200" alt="" />

 

I could probably do it with php by getting the option value but that means I'd have to submit the page first, which I'm trying to avoid. javascipt might be able to do this onclick?

 

Cheers

 

Os

 
Replies

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points