// Add option
Function AddOption (POS) {
Var objselect = document.myform.myselect;
// Take a field value
Var strname = document.myform.myoptionname.value;
Var strval = document.myform.myoptionValue.Value;
// Establish an Option object
Var objoption = new option (strname, strvalue);
IF (POS == -1 & POS> Objselect.Options.LENGTH)
Objselect.Options [objselect.Options.Length] = Objoption;
Else
Objselect.Add (Objoption, POS);
}
// Delete Options
Function deleteOption (TYPE) {
Var objselect = document.myform.myselect;
IF (Type == True)
Objselect.Options [objselect.selectedIndex] = NULL;
Else
Objselect.remove (objselect.selected ";
}
// Display option information
Function showoption (objform) {
Var objselect = objform.myselect;
Var name = objselect.Options [objselect.selected ".TEXT;
VAR value = objselect.Options [objselect.selected ".value;
Alert (Name "=" value);
}
script>
hEAD>