Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use selection from drop list to load img src=

Status
Not open for further replies.

cc4mail

Technical User
Jan 8, 2002
47
US
This seemed simple enough. I am using the selection from a drop list (form1.option.value) as the source to load an image file.

<img src=form1.option.value>

what am i doing wrong?

 
You want this set when the page loads? Use This...

<img src=&quot;somePic.jpg&quot; onLoad=&quot;this.src = document.form1.mySelect.options[document.form1.mySelect.selectedIndex].value&quot;>

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
Thanks, it always makes sense when someone else does it right...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top