Skip to main content

SetLabel

Sets the label for the current check box.

Syntax

expression.SetLabel(label);

expression - A variable that represents a ApiCheckBoxForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
labelRequiredstringThe label.

Returns

boolean

Example

This example sets the label text to the checkbox form.

// How to add a label to the checkbox form.

// Set a label text to the checkbox.

let doc = Api.GetDocument();
let checkBoxForm = Api.CreateCheckBoxForm({"tip": "Specify your marital status", "required": true, "radio": true, "key" : "Marital status"});
checkBoxForm.SetLabel(" Married");
let paragraph = doc.GetElement(0);
paragraph.AddElement(checkBoxForm);
paragraph.AddLineBreak();
checkBoxForm = Api.CreateCheckBoxForm({"tip": "Specify your marital status", "required": true, "radio" : true, "key" : "Marital status"});
checkBoxForm.SetLabel(" Single");
paragraph.AddElement(checkBoxForm);