跳到主要内容

SetText

Sets the text to the current combo box. Available only for editable combo box forms.*

Syntax

expression.SetText(sText);

expression - A variable that represents a ApiComboBoxForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sTextRequiredstringThe combo box text.

Returns

boolean

Example

This example sets the text to the current combo box.

let doc = Api.GetDocument();
let comboBoxForm = Api.CreateComboBoxForm({"key": "Personal information", "tip": "Choose your country", "required": true, "placeholder": "Country", "editable": true, "autoFit": false, "items": ["Latvia", "USA", "UK"]});
let paragraph = doc.GetElement(0);
paragraph.AddElement(comboBoxForm);
comboBoxForm.SetText("France");