Posted By:
Firat_Tiryaki
Posted On:
Saturday, June 22, 2002 04:29 AM
You should use Option object to dynamically edit the combo boxes.
The Option object is created using the word new
myOption= new Option();
the text and the value of the Option object is set just like below
myOption.text="option text here";
myOption.value="option value here";
The option can be inserted into selection defining the option index number. Below the option is inserted at the end of a selection
document.formName.selectName.options[document.formName.selectName.options.length]=myOption;
The option can be deleted just setting the option to null
document.formName.selectName.options[1]=null; --> the second option is deleted.
Take a look at the brief example below to make sure about how the things are going.
--------------------------------------------------
Untitled
--------------------------------------------------