For example you could have the following CheckBox:
- <ss:forms:checkbox name="switch" valuechecked="on" valueunchecked="off" />
Or you could have valuechecked="blue" valueunchecked="red", which implies that the default value for this particular parameter is "red", rather than no value at all.
Where CheckBoxes shine is where you need the user to specify zero, one, or many values for a single item in a form:
- <ss:forms:checkbox name="colours" valuechecked="red" />
- <ss:forms:checkbox name="colours" valuechecked="green" />
- <ss:forms:checkbox name="colours" valuechecked="blue" />
Here the user can select the colours they like, which will be posted to the server to the field colours. Note valueunchecked is not relevent in this case; if no values are selected then the value for colours is empty.
Radio buttons belonging to the same group will have to share the same name.
Defaults to "1", which is fine if you have a single checkbox for enabling/disabling a boolean option.
If you have multiple checkboxes for the same name, then each must have a different valuechecked.
Relevent only when there is a single checkbox for a given name.
Single Basic Checkbox
The most basic of checkboxes.
Multiple Checkboxes of Same Name
Demonstrates multiple checkboxes mapped to the same name.
AJAX Interaction (Terms and Conditions Example)
Demonstrates showing and hiding elements inside an AJAX Region depending on the state of a checkbox.
ValueChecked and ValueUnchecked
Alters the result of the checkboxes value when checked or unchecked.