Radio group

fi.aisti.radiogroup

Creates a group of radio buttons for selecting a value
Current version1.0
Author Aisti
Visit Aisti's site

Download now

Currently you are only able to download controls through Bildy Editor.

Description

When you have to choose something from just a few options, radio group is the way to go. All options are visually available which makes selecting the right one quick (when there are more options, droplist becomes better).

Radio Group creates a group of radio buttons defined in control's settings. The selected option will be saved to the database.

Documentation

Attributes for output tag:

selected

Set selected value by using element's value (not the key name) inside this attribute.

selectedindex

Set selected value by using element's number (starting from 0) inside this attribute.

append

Adds options to the beginning of the list. If selected and submitted, these values will be saved to the data base. However, these values cant be selected through Bildy editor.

Values must be given as arrays in a JSON where for each option there is an array consisting label and value-keys.

For example: // This adds two options to the beginning: "Any color" with no value, and "Red" with value 1
<b:form.radiogroup append="[['label':'Any color', 'value':'']['label':'Red', 'value':'1']]" />

While the style above is recommended, you can shortcut by giving array with to values. The first one will be used as label and the second one as value. // This adds two options to the beginning: "Any color" with no value, and "Red" with value 1
<b:form.radiogroup append="[['Any color', '']['Red', '1']]" />

If no value is given, label will also be used as value. // This adds two options to the beginning: "Any color" with value "Any color", and "Red" with value 1
<b:form.radiogroup append="[['Any color']['Red','1']]" />

Note that if you're passing these attributes in HTML, unlike strict JSON format, you can use ' instead of ".

prepend

Works like append, but adds options to the end of option list.