Click to See Complete Forum and Search --> : disply imges whith jscript in drop down box


A. J.
09-02-2003, 10:42 PM
Hi
I made this code to display all images which are in current directory and i tried to put the names of these images in drop down box... here are the codes

<html>
<head>
<script language="javascript">
<!--
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
//-->
</script>
</head>

<body>
<%
' Create an instance of the FileSystemObject
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFileObject.GetFolder(Server.MapPath("/zad-alrida/images/products/"))
response.write(MyFolder)
'Loop trough the files in the folder
FOR EACH thing in MyFolder.Files
%>

<form name="mygallery"><p>&nbsp;<img src="<%=thing.Name%>" name="pictures" width="99" height="100">
<select name="picture" size="1" onChange="showimage()">
<option selected value="<%=thing.Name%>"><%=thing.Name%></option>
<% next %>
</select></form>
</body>

the problem is that all images are displayed but what I want is to display one image and it is name and wheen i change the image name from the drop down box the image change too.


any solution guys :(