跳到主要内容

GetClassType

返回 ApiTextForm 类的类型。

语法

expression.GetClassType();

expression - 表示 ApiTextForm 类的变量。

参数

此方法没有任何参数。

返回值

"textForm"

示例

检查文本表单返回的类类型。

// How do I check what type a text form object is?

// Retrieve and output the class type string for a text form.

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