dakoz
Programmer
- Feb 2, 2002
- 74
i have the following script which selects from a drop down list an image name and at the same time makes a preview.
<SCRIPT LANGUAGE="JavaScript">
<!--
function imgchange()
{
var si = document.frm.selbox.selectedIndex;
var fname = document.frm.selbox.options[si].value
document.img.src = fname
}
//-->
</SCRIPT>
<FORM name="frm">
<SELECT NAME="selbox" size=1" onchange=imgchange()>
<OPTION VALUE=" 1 (12/4/2002)
<OPTION VALUE=" 2 (19/5/2002)
<OPTION VALUE=" 3 (22/5/2003)
</SELECT>
</FORM>
<IMG SRC="1.gif" NAME="img">
all good until here.
How can make this script load the name and the url from a text file and generate the form above?
the file has the following format
Image 1 - Image 2 - Image 3 - etc.
<SCRIPT LANGUAGE="JavaScript">
<!--
function imgchange()
{
var si = document.frm.selbox.selectedIndex;
var fname = document.frm.selbox.options[si].value
document.img.src = fname
}
//-->
</SCRIPT>
<FORM name="frm">
<SELECT NAME="selbox" size=1" onchange=imgchange()>
<OPTION VALUE=" 1 (12/4/2002)
<OPTION VALUE=" 2 (19/5/2002)
<OPTION VALUE=" 3 (22/5/2003)
</SELECT>
</FORM>
<IMG SRC="1.gif" NAME="img">
all good until here.
How can make this script load the name and the url from a text file and generate the form above?
the file has the following format
Image 1 - Image 2 - Image 3 - etc.