SetPlaceholder
Sets text field placeholder.
Syntax
expression.SetPlaceholder(sPlaceholder);
expression - A variable that represents an ApiTextField class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| sPlaceholder | Required | string | field placeholder |
Returns
boolean
Example
Add a hint text that appears before you type in a text field in a PDF.
// Useful for adding a hint text to an empty text field in a PDF.
// Configure what example text shows when a text field is empty in a PDF.
let doc = Api.GetDocument();
let page = doc.GetPage(0);
let textField = Api.CreateTextField([10, 10, 160, 30]);
page.AddObject(textField);
textField.SetPlaceholder("Your text here");