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
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| keepContent | Required | boolean | Specifies if the content will be deleted or not. |
Returns
boolean
Example
This example shows how to delete the checkbox form.
- Code
- Result
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();