GetPlaceholderText
Returns the placeholder text from the current form.
Syntax
expression.GetPlaceholderText();
expression - A variable that represents a ApiDateForm class.
Parameters
This method doesn't have any parameters.
Returns
string
Example
This example shows how to get the placeholder text of a form.
- Code
- Result
// How to get the placeholder text of a text form.
// Retrieve the placeholder text of a created text form and display it.
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");
let placeholderText = textForm.GetPlaceholderText();
paragraph = Api.CreateParagraph();
paragraph.AddText("Placeholder text: " + placeholderText);
doc.Push(paragraph);