<div class="Form-select">
<select id="" name="" class="" style="">
</select>
</div>
{{#if label}}
<label>
<span>
{{{label}}}
{{#if helptext}}<span class="help-text"> {{{helptext}}}</span>{{/if}}
</span>
{{/if}}
<div class="Form-select">
<select
id="{{id}}"
name="{{name}}"
class="{{modifier}}"
style="{{style}}"
{{#if required}} required{{/if}}
>
{{#if options}}
{{#each (createoptions options)}}
<option value="{{value}}" {{#if attribute}}{{attribute}}{{/if}}>{{label}}</option>
{{/each}}
{{/if}}
</select>
</div>
{{#if label}}
</label>
{{/if}}
{
"label": null,
"id": null,
"name": null,
"helptext": null,
"required": null,
"options": null
}
A basic select/option component for use on forms.
The options property takes a pipe and line-delimited string that is parsed into the various options. Each line is an option and each option takes the following properties as pipe-delimited strings:
label
(required) - The user-facing text to show in the option.value
(optional) - The value sent via the form.label
value will be usednosubmit
the value will be empty (helpful if you need to prevent
submission of a field that is disabled
and selected
)attributes
(optional) - A string of space-separated attributes to append to
the option. Example: disabled selected
.Examples:
<label>|<value>|<attributes> //==> all properties explicitly set
<label>||<attributes> //==> label is used for label and value
<label>|nosubmit|<attributes> //==> option fails validation if field is required