Skip to main content

SetValueIndexes

Sets selected value indexes.

Inherited from ApiBaseListField.SetValueIndexes.

Example

Mark items as selected in a dropdown by their position in a PDF.

// How do I select options by index in a dropdown field in a PDF?

// Choose items from a list using their numeric positions in a PDF.

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