forms:checkboxgroup
AJAX
ajax:delayedload ajax:event ajax:navigation ajax:region
Data
data:calendar data:column data:eventrepeater data:postrepeater data:productbrandrepeater data:productcategoryrepeater data:productrepeater data:repeater data:table data:template data:tree
Forms
forms:address forms:captcha forms:checkbox forms:checkboxgroup
ATTRIBUTES
EXAMPLES
forms:codeeditor forms:combobox forms:datepicker forms:dialogbox forms:editbox forms:fileupload forms:form forms:hidden forms:money forms:officeuseregion forms:option forms:password forms:paymentmethod forms:radiobutton forms:radiobuttongroup forms:row forms:searchbox forms:signature forms:slider forms:spinbox forms:submitbutton forms:submitimage forms:submitlink forms:successcontent forms:textarea forms:timepicker
Layout
layout:gallery layout:productgallery layout:rotator layout:stepper layout:stepperpanel layout:tablist layout:tablistitem
Logic
logic:dependency logic:else logic:if logic:include logic:parse logic:variable
Navigation
navigation:breadcrumbs navigation:item navigation:primary navigation:secondary
Personalisation
personalisation:firstname personalisation:fullname personalisation:lastname personalisation:other
Standard
standard:audio standard:embed standard:icon standard:image standard:link standard:script standard:tooltip standard:video
Templates
templates:button templates:card templates:column templates:fancybox templates:faq templates:flexlayout templates:header templates:row templates:section templates:styles templates:teammember templates:testimonial
Regions
regions:content regions:contentadditional regions:security regions:togglable
Third Party
thirdparty:googlemap thirdparty:googlemapmarker

<forms:checkboxgroup> </...>

This control is intended to simplify the grouping of checkbox values.
Wrapping checkboxes in a group allows you to omit the name and validation attributes on individual checkboxes by applying them via name and validations attributes on the group.

Content

Must contain at least 1 checkbox tag.

Attributes

align
string
Align

Sets the alignment of checkboxes in the group.

Possible values: [Default] vertical, horizontal
id
string
(Required) Give this control a unique id. Can be accessed in the client DOM (eg, document.getElementById('myid') or in the server DOM using [? $myid ?] or [? $('myid') ?]).
name
string
Name

Sets the name value which will be applied to all child Checkboxes. For
Checkboxes, the name attribute indicates which form field they will submit their value to.

Note: Uses the same [ ] syntax as forms:checkbox

Eg: name="fruits[]"
validations
string
Validations

Sets the validations to be applied to child checkboxes as a comma separated string.

Eg: validations="mandatory"

Examples

Grouping Checkboxes

The name of the checkbox group acts as the field to which the checkboxes will map. This is used instead of applying a name attribute to each individual checkbox.

HTML:

<forms:row label="Preferred Fruit"> <forms:checkboxgroup name="fruit[]" validations="mandatory"> <forms:checkbox valuechecked="apple" label="Apple" /> <forms:checkbox valuechecked="orange" label="Orange" /> <forms:checkbox valuechecked="pear" label="Pear" /> </forms:checkboxgroup> </forms:row>

Populate From Datasource

CheckBoxes can be repeated from a datasource using a repeater. Take care to ensure that any generated valuechecked attributes will be unique.

HTML:

<forms:checkboxgroup name="favourite_products[]" validations="mandatory"> <data:repeater datasource="\Components\Commerce\Products::getAll()" as="product"> <forms:checkbox valuechecked="[? $product['product_id'] ?]" label="[? $product['product_title'] ?]" /> </data:repeater> </forms:checkboxgroup>