How can i write this code so it will get a recordset colorPath
recordset("colorPath"
and loop through the drop down menu and if the recordset colorPath is the same as the image path then it will have that option selected.
<script LANGUAGE="javascript">
<!--
var images = new Array(
"/images/orange.gif","Orange",
"/images/blue.gif", "Blue",
"/images/brown.gif","Brown",
"/images/images/green.gif","Green"
);
//-->
</script> <script LANGUAGE="javascript">
<!--
function displayImage()
{
var IFname = document.formsettings.s.options[document.formsettings.s.selectedIndex].value;
document.im.src = IFname;
}
document.writeln('<select name ="s" onChange ="displayImage()">');
document.write('<option selected value="',images[0],'"> ');
document.writeln(images[1],' </option>');
for (i=2; i<images.length; i+=2)
document.writeln('<option value="',images,'"> ',images[i+1],' </option>');
document.writeln('</select>');
document.writeln(' <IMG name="im" SRC="',images[0],'" BORDER=0>');
//-->
</script>
thanks
recordset("colorPath"
and loop through the drop down menu and if the recordset colorPath is the same as the image path then it will have that option selected.
<script LANGUAGE="javascript">
<!--
var images = new Array(
"/images/orange.gif","Orange",
"/images/blue.gif", "Blue",
"/images/brown.gif","Brown",
"/images/images/green.gif","Green"
);
//-->
</script> <script LANGUAGE="javascript">
<!--
function displayImage()
{
var IFname = document.formsettings.s.options[document.formsettings.s.selectedIndex].value;
document.im.src = IFname;
}
document.writeln('<select name ="s" onChange ="displayImage()">');
document.write('<option selected value="',images[0],'"> ');
document.writeln(images[1],' </option>');
for (i=2; i<images.length; i+=2)
document.writeln('<option value="',images,'"> ',images[i+1],' </option>');
document.writeln('</select>');
document.writeln(' <IMG name="im" SRC="',images[0],'" BORDER=0>');
//-->
</script>
thanks