Skip to main content

Delete

Removes a form and its content. If keepContent is true, the content is not deleted.

Syntax

expression.Delete(keepContent);

expression - A variable that represents a ApiDateForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
keepContentRequiredbooleanSpecifies if the content will be deleted or not.

Returns

boolean

Example

This example shows how to delete the checkbox form.

const doc = Api.GetDocument();
const checkBoxForm = Api.CreateCheckBoxForm({
'key': 'Marital status',
'tip': 'Specify your marital status',
'placeholder': 'Marital status',
'radio': true
});
let paragraph = doc.GetElement(0);
paragraph.AddElement(checkBoxForm);
paragraph.AddText(' Married');
let copyCheckBoxForm = checkBoxForm.Copy();
paragraph.AddLineBreak();
paragraph.AddElement(copyCheckBoxForm);
paragraph.AddText(' Single');
checkBoxForm.Delete();