Skip to main content

SetPlaceholderText

Sets the placeholder text to the current form.

note

The placeholder text can't be set for checkbox or radio button forms.

Inherited from ApiFormBase.SetPlaceholderText.

Syntax​

expression.SetPlaceholderText(sText);

expression - A variable that represents an ApiTextForm class.

Parameters​

NameRequired/OptionalData typeDefaultDescription
sTextRequiredstringThe text that will be set to the current form.

Returns​

boolean

Example​

Add placeholder text to a text field in a document.

// How do I display hint text inside a text field before the user starts typing in a document?

// Guide users by placing descriptive hint text inside an empty text field in a document.

let doc = Api.GetDocument();
let textForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(textForm);
textForm.SetPlaceholderText("First name");