mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
14b1e93e85
Most types of form field will now include aria-required="true" if the field is marked as required. This causes assistive technology to inform users that the field is required. Before this change, in some cases (e.g. screen reader users tabbing through fields) users were not informed that a field is required.
38 lines
1.5 KiB
Plaintext
38 lines
1.5 KiB
Plaintext
{{< core_form/element-template-inline }}
|
|
{{$element}}
|
|
{{^element.frozen}}
|
|
{{#element.multiple}}
|
|
<input type="hidden" name="{{element.nameraw}}" value="_qf__force_multiselect_submission">
|
|
{{/element.multiple}}
|
|
<select class="{{^element.multiple}}custom-select{{/element.multiple}}
|
|
{{#element.multiple}}form-control{{/element.multiple}}
|
|
{{#error}}is-invalid{{/error}}"
|
|
name="{{element.name}}"
|
|
id="{{element.id}}"
|
|
{{#element.multiple}}multiple{{/element.multiple}}
|
|
{{#element.size}}size="{{element.size}}"{{/element.size}}
|
|
{{#error}}
|
|
autofocus aria-describedby="{{element.iderror}}"
|
|
{{/error}}
|
|
{{#required}}
|
|
aria-required="true"
|
|
{{/required}}
|
|
{{{element.attributes}}} >
|
|
{{#element.options}}
|
|
<option value="{{value}}" {{#selected}}selected{{/selected}} {{#disabled}}disabled{{/disabled}} {{{optionattributes}}}>{{{text}}}</option>
|
|
{{/element.options}}
|
|
</select>
|
|
{{/element.frozen}}
|
|
{{#element.frozen}}
|
|
{{#element.options}}
|
|
{{#selected}}
|
|
{{{text}}}
|
|
{{^element.hardfrozen}}
|
|
<input type="hidden" name="{{element.name}}" value="{{value}}" id="{{element.id}}">
|
|
{{/element.hardfrozen}}
|
|
{{/selected}}
|
|
{{/element.options}}
|
|
{{/element.frozen}}
|
|
{{/element}}
|
|
{{/ core_form/element-template-inline }}
|