跳到主要内容

SetTipText

设置当前表单的提示文本。

继承自 ApiFormBase.SetTipText

示例

为表单设置提示文本。

// Add text as a tip of the form.

// Create a text form and set its tip text (text that appears on hold).

let doc = Api.GetDocument();
let textForm = Api.CreateTextForm({"key": "Personal information", "required": true, "placeholder": "First name", "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(textForm);
textForm.SetTipText("Enter your first name");
let tipText = textForm.GetTipText();
paragraph = Api.CreateParagraph();
paragraph.AddText("Tip text: " + tipText);
doc.Push(paragraph);