Skip to main content

Delete

Removes a form and its content.

If keepContent is true, the content is not deleted.

Inherited from ApiFormBase.Delete.

Syntax​

expression.Delete(keepContent);

expression - A variable that represents an ApiCheckBoxForm class.

Parameters​

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

Returns​

boolean

Example​

Remove a checkbox form field from a document.

// How do I permanently delete a checkbox from the document in a document?

// Clean up a form by removing an unwanted radio button after it is no longer needed in a document.

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