Skip to content

Radio Buttons#

Radio buttons allow users to select a single option from a set of choices in Imperia templates.

Syntax#

The syntax for creating a radio button in Imperia templates is as follows:

<input name="IMPERIA:name" type="radio" value="value" checked="checked" />

In this syntax, IMPERIA:name represents the field name for the radio button. You can replace name with your desired field name, and value with the corresponding value for the radio button.

Default Selection#

To set a default selection for a radio button, use the checked="checked" attribute. This determines whether an option is preselected when the template is rendered.

Example#

Here's an example that demonstrates the usage of radio buttons:

<input name="IMPERIA:radio1" type="radio" value="one" />
<input name="IMPERIA:radio1" type="radio" value="two" checked="checked" />
<input name="IMPERIA:radio1" type="radio" value="three" />

In this example, the radio buttons with the name attribute IMPERIA:radio1 form a group, allowing users to choose one option from the available choices. The second radio button is set as the default selection using the checked="checked" attribute.

By utilizing radio buttons in your Imperia templates, you can provide users with a straightforward way to select a single option from a set of choices.