Skip to main content

RemoveOption

Removes option from list options.

Syntax

expression.RemoveOption(nPos);

expression - A variable that represents a ApiComboboxField class.

Parameters

NameRequired/OptionalData typeDefaultDescription
nPosRequirednumberpos to remove option

Returns

boolean

Example

This example removes option from field with list of options.

let doc = Api.GetDocument();
let page = doc.GetPage(0);
let comboboxField = Api.CreateComboboxField([10, 10, 160, 30]);
page.AddObject(comboboxField);

comboboxField.AddOption('Option 1');
comboboxField.AddOption('Option 2');
comboboxField.AddOption('Option 3');
comboboxField.SetValueIndexes([0]);
comboboxField.RemoveOption(2);