wind0965
01-14-2004, 03:00 PM
I would like to acess the unselected options of a combobox, or even write new ones to it.
The code is like:
...
<select size="1" name="MLFB_Selection">
<option label="option0" selected="selected">Tom</option>
<option label="option1">Jack</option>
<option label="option2">John</option>
</select></td>
...
and the script part is:
function refreshMLFB(){
var File4read, MLFB = new Array(6);
var ForReading = 1;
var i = 0;
MLFBPath = document.CaliForm.MLFBPathFile.value;
fs = new ActiveXObject("Scripting.FileSystemObject");
File4read = fs.OpenTextFile(MLFBPath, ForReading, true);
while(!File4read.AtEndOfStream)
{
MLFB[i] = File4read.readline();
i++;
}
document.CaliForm.MLFB_Selection.option0.value = MLFB[0];
document.CaliForm.MLFB_Selection.option1.value = MLFB[1];
File4read.close();
}
...
This function is called somewhere.
I don't if "document.CaliForm.MLFB_Selection.option0.value = MLFB[0];" is right.
Thank you in advance.
The code is like:
...
<select size="1" name="MLFB_Selection">
<option label="option0" selected="selected">Tom</option>
<option label="option1">Jack</option>
<option label="option2">John</option>
</select></td>
...
and the script part is:
function refreshMLFB(){
var File4read, MLFB = new Array(6);
var ForReading = 1;
var i = 0;
MLFBPath = document.CaliForm.MLFBPathFile.value;
fs = new ActiveXObject("Scripting.FileSystemObject");
File4read = fs.OpenTextFile(MLFBPath, ForReading, true);
while(!File4read.AtEndOfStream)
{
MLFB[i] = File4read.readline();
i++;
}
document.CaliForm.MLFB_Selection.option0.value = MLFB[0];
document.CaliForm.MLFB_Selection.option1.value = MLFB[1];
File4read.close();
}
...
This function is called somewhere.
I don't if "document.CaliForm.MLFB_Selection.option0.value = MLFB[0];" is right.
Thank you in advance.