Computing.Net > Forums > Web Development > dropdown list opening image file

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

dropdown list opening image file

Reply to Message Icon

Name: bbosh75
Date: April 5, 2006 at 10:17:26 Pacific
OS: WINXP
CPU/Ram: 2.0 ghz / 512
Product: HP
Comment:

I am trying to create in Frontpage a multi column table that in one colum I will have a drop down list that the item selected will place a image file in the adjoining column. Is there a way to do this and how? Thanks for helping.



Sponsored Link
Ads by Google

Response Number 1
Name: jb60606
Date: April 5, 2006 at 21:31:55 Pacific
Reply:

I'm using javascript and an "image place holder" for that, for
a gallery I'm currently building:

http://robinred.odiousj.com/gallery3/gallery3.html

There are quite a few tutorials for the method on the
internet, though shoot me an email if you'd like the code. My
code is a tad rough around the edges, though works fine.


0

Response Number 2
Name: jb60606
Date: April 5, 2006 at 21:34:16 Pacific
Reply:

by the way, you probably can't tell because all of the text is
the same right now, but there is also a text "place holder" at
the bottom of the frame that changes with every thumbnail/
image selected.


0

Response Number 3
Name: jb60606
Date: April 5, 2006 at 22:25:33 Pacific
Reply:

DOH! Sorry - missed the part about the drop-down menu. I
don't have any code for that though I'm sure the image
placeholder could still be applied here.


0

Response Number 4
Name: Michael J (by mjdamato)
Date: April 6, 2006 at 08:37:14 Pacific
Reply:

Here's a simple script for accomplishing what you want. Copy and past the following into an htm page. You can then modify the code as you need. The path variable is to set the path to the image directory (note: had to change some <> to [] for posting reasons):

<html>
<head>
<script language="javascript">

path = ""; //path to the image files
function changeImage(fieldID,imageFile) {
if (document.images) {
document[fieldID].src = path + imageFile;
}
}
</script>
</head>
<body>

[select onchange="changeImage('testImage',this.value)"]
<option value="image1.jpg">Image 1</option>
<option value="image2.jpg">Image 2</option>
[/select]

[img name="testImage" src="image1.jpg"]

</body>
</html>

Michael J


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: dropdown list opening image file

Help with opening kmz file www.computing.net/answers/webdevel/help-with-opening-kmz-file/2804.html

Problems opening .chm file www.computing.net/answers/webdevel/problems-opening-chm-file/2622.html

Can't open the HTML file! www.computing.net/answers/webdevel/cant-open-the-html-file/3149.html