Skip to main content

Add

Appends the text content of the given form to the end of the current complex form.

Syntax

expression.Add(value);

expression - A variable that represents a ApiComplexForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
valueRequiredstring | ApiDateForm | ApiPictureForm | ApiCheckBoxForm | ApiComboBoxForm | ApiTextFormThe text or the form to add.

Returns

boolean

Example

This example creates complex form with multiple elements, including a text input form and static text.

let doc = Api.GetDocument();
let complexForm = Api.CreateComplexForm({"key": "Email", "tip": "Email", "placeholder": "Start to fill complex form"});
complexForm.Add(Api.CreateTextForm());
complexForm.Add("@onlyoffice.com");
let paragraph = doc.GetElement(0);
paragraph.AddElement(complexForm);