View Full Version : About Combobox

01-14-2004, 04: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>

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);

MLFB[i] = File4read.readline();

document.CaliForm.MLFB_Selection.option0.value = MLFB[0];
document.CaliForm.MLFB_Selection.option1.value = MLFB[1];



This function is called somewhere.
I don't if "document.CaliForm.MLFB_Selection.option0.value = MLFB[0];" is right.

Thank you in advance.

Mr J
01-15-2004, 04:32 PM
To state new values you need something like

form_name.option_name.options[index]=new Option(value);

Take a look at this script at


to give you a better idea

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum