CHECKBOX - AppDaddy-Software-Solutions-Inc/framework-markup-language GitHub Wiki

<CHECKBOX/> : FormField

The <CHECKBOX/> or <CHECK/> widget is a group of one or more checkboxes. Each checkbox in the group is represented by a single checkbox <OPTION/>.

Each checkbox <OPTION/> contains a single value. The value of the <CHECKBOX/> itself is a comma separated list of the value of each <OPTION/> selected.

<OPTION/>'s can be defined either statically by placing them inside of the <CHECKBOX/> (example #1), or dynamically by creating a single prototype <OPTION/> and linking the checkbox to a data source using the checkbox's data attribute (example #3).

Attributes

Name Type Default Description Req
value list A comma separated list of one or more values corresponding to the value of each option (example #1) or individual value elements (example #2). The can also be set by leaving value empty and using the option's selected property.
size int 24 The size in pixels of each checkbox
center boolean false When true, the checkboxes are centered within the layout
layout string column Determines how checkboxs are laid one relative to one another. Values are row or column
wrap boolean false Automatically wraps on screen resize
data string Dynamic option creation based on a data source where id is the id of the datasource

Methods

Name Description
check checks all options
uncheck unchecks all options
toggle toggles the options, sets checked options to unchecked, unchecked options to checked

Examples

Example #1 : static checkbox with 4 options with checkbox value set to a,c using the value property

img

<CHECKBOX id="checkboxinput" size="65" value="a,c" layout="row">
  <OPTION value="a" label="A" />
  <OPTION value="b" label="B" />
  <OPTION value="c" label="C" />
  <OPTION value="d" label="D" />
</CHECKBOX>

logo See it in Action

Example #2 : static checkbox with 4 options with the checkbox value set to a,c using elements
<CHECKBOX id="checkboxinput" size="65">
  <value>a</value> 
  <value>c</value> 
  <OPTION value="a" label="A"/>
  <OPTION value="b" label="B"/>
  <OPTION value="c" label="C"/>
  <OPTION value="d" label="D"/>
</CHECKBOX>

logo See it in Action

Example #3 : static checkbox with 4 options with checkbox value set to a,c using the option's selected property
<CHECKBOX id="checkboxinput" size="65">
  <OPTION value="a" label="A" selected="true"/>
  <OPTION value="b" label="B"/>
  <OPTION value="c" label="C" selected="true"/>
  <OPTION value="d" label="D"/>
</CHECKBOX>

logo See it in Action

Example #4 : dynamic checkbox based on a data source
<CHECKBOX id="monthcheckbox" data="MONTHS">
	<value>January</value>     
	<value>March</value>     
	<OPTION value="{data.month}" label="{data.month}"/>
</CHECKBOX>

<DATA id="MONTHS" root="ROWS.ROW">
<value>
	<![CDATA[<ROWS>
		<ROW>
			<month>January</month>
		</ROW>
		<ROW>
			<month>February</month>
		</ROW>
		<ROW>
			<month>March</month>
		</ROW>
		<ROW>
			<month>April</month>
		</ROW>
		<ROW>
			<month>May</month>
		</ROW>
		<ROW>
			<month>June</month>
		</ROW>
		<ROW>
			<month>July</month>
		</ROW>
		<ROW>
			<month>August</month>
		</ROW>
		<ROW>
			<month>September</month>
		</ROW>
		<ROW>
			<month>October</month>
		</ROW>
		<ROW>
			<month>November</month>
		</ROW>
		<ROW>
			<month>December</month>
		</ROW>
	</ROWS>]]>
</value>
</DATA>

logo See it in Action

Other Widgets You May Find Useful:

⚠️ **GitHub.com Fallback** ⚠️