跳到主要内容

SetPlaceholder

Sets text field placeholder.

Syntax

expression.SetPlaceholder(sPlaceholder);

expression - A variable that represents a ApiTextWidget class.

Parameters

NameRequired/OptionalData typeDefaultDescription
sPlaceholderRequiredstringfield placeholder

Returns

boolean

Example

This example sets placeholder for text widget.

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

let widgets = comboboxField.GetAllWidgets();
widgets[0].SetPlaceholder('Your text here');