Select Box#
Select boxes provide users with the ability to choose one option from a list of multiple options in Imperia templates.
Syntax#
The syntax for creating a select box in Imperia templates is as follows:
<select name="IMPERIA:select">
<option value="option1">first option</option>
<option value="option2">second option</option>
</select>
In this syntax, IMPERIA:select represents the field name for the select box. You can replace select with your desired field name.
Selecting Default Value#
To set a default value for the select box, use the following syntax:
<option value="option1" selected="selected">first option</option>
In this example, option1 is set as the default selected option. By using the selected="selected" attribute, you can ensure that a specific option is preselected when the template is rendered.
Displaying Selected Option#
The value of the selected option in the select box is displayed in the final document. This allows you to modify the displayed texts without having to change the underlying meta variable.
By utilizing select boxes in Imperia templates, you can provide users with a convenient way to choose from multiple options while capturing their selection for further processing.