GetPlaceholderText
返回当前表单的占位符文本。
语法
expression.GetPlaceholderText();
expression - 表示 ApiTextForm 类的变量。
参数
此方法没有任何参数。
返回值
string
示例
此示例展示如何获取表单的占位符文本。
// 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);