跳到主要内容

CreateTextForm

Creates a text field with the specified text field properties.

Syntax

expression.CreateTextForm(oFormPr);

expression - A variable that represents a Api class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oFormPrRequiredTextFormPrText field properties.

Returns

ApiTextForm

Example

This example creates a a text form with the common and specific text form properties.

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);