f:form.select¶
This ViewHelper enables you to create a <select> dropdown list for the use with a HTML form.
Properties¶
All the universal tag attributes
All the universal form field attributes
Exclusive properties for the HTML-Element¶
multiple¶
- Variable type
- String
- Description
- When this option is selected, the website visitor can concurrently select more than one option.
- Default value
- NULL
- Mandatory
- No
size¶
- Variable type
- String
- Description
- Defines the number of options which are displayed at the same time.
- Default value
- NULL
- Mandatory
- No
disabled¶
- Variable type
- String
- Description
- When this option is selected, the SELECT element is deactivated in the browser, and no options can be selected by the website visitor.
- Default value
- NULL
- Mandatory
- No
Exclusive properties of this ViewHelper¶
options¶
- Variable type
- Array
- Description
- The options which are to be displayed in the SELECT element.
Default value
- Mandatory
- Yes
optionsAfterContent¶
- Variable type
- Boolean
- Description
- If true, places auto-generated option tags after those rendered in the tag content. If false, automatic options come first.
- Default value
- FALSE
- Mandatory
- Yes
optionValueField¶
- Variable type
- String
- Description
- When the element contains options, then this property allows you to define which of the related records' properties are used as the option value. (This will be sent to the server.) This property only works when using data related to an Object.
Default value
- Mandatory
- No
optionLabelField¶
- Variable type
- String
- Description
- When the element contains options, then this property allows you to define which of the related records' properties are used as the visible text in the SELECT element. This property only works when using data related to an Object.
Default value
- Mandatory
- No
sortByOptionLabel¶
- Variable type
- Boolean
- Description
- Should the list of available options be sorted alphabetically, according to the visible text?
- Default value
- FALSE
- Mandatory
- No
selectAllByDefault¶
- Variable type
- Boolean
- Description
- If the
multiple
property is active and thesize
of the field is larger than 1, using this property allows you to define that all of the available options are selected by default. - Default value
- FALSE
- Mandatory
- No
errorClass¶
- Variable type
- String
- Description
- A CSS class name which can be assigned when the validator for this field identifies an error.
- Default value
- f3-form-error
- Mandatory
- No
prependOptionLabel¶
- Variable type
- String
- Description
- The visible text of an additional option which will be prepended to the list.
Default value
- Mandatory
- No
prependOptionValue¶
- Variable type
- String
- Description
- The value of an additional option which will be prepended to the list.
Default value
- Mandatory
- No
Tip
The properties optionValueField
and optionLabelField
only work when using data related to an Object.
Examples¶
<f:form.select name="myExtName[country]" options="{data.countries}" />
or
<f:form.select property="country" options="{data.countries}" />