This only happens to DateTimePickers - as the visible Id is appended with a _1 to prevent duplicate Ids with the Hidden Input. - can we swap the _1 to the hidden input?
Is there something that we can do to update the input controls so that this can pass the Total validator checks?
You can override the markup of the form fields and make the necessary changes there to be compliant.
Depending on which version of Umbraco Forms you are using there are two different ways:
Forms v6+: you can use Themes to create a custom theme and override the FieldType views you want to change as described here.
Forms v5 or older: you can change the default FieldType views in the Views\Partials\Forms folder as described here. The drawback of this older version is that your changes might be overridden when Forms gets upgraded to a newer version (hence why themes were introduced in v6).
Thanks for this - its really helpful and exactly what we are looking for.
Can I double check the ID of the Datepicker? it seems to be appending a _1 to the ID. Is it OK to swap this ID with the Hidden field or does the ID of the visible "input" field need to be the one with the Underscore? The reason for this is that the Label For Id has nothing to reference to and Total validator is throwing an accessibility error.
Umbraco Forms - failing WCAG 2.1 accessibility checks
Hi,
We need all our sites to pass WCAG2.1 and a lot of our sites use Umbraco Forms.
These forms are failing our checks as the Input controls have an invalid name attribute or do not have a label.
for example:
This only happens to DateTimePickers - as the visible Id is appended with a _1 to prevent duplicate Ids with the Hidden Input. - can we swap the _1 to the hidden input?
Is there something that we can do to update the input controls so that this can pass the Total validator checks?
Thanks for all your help Jon
Hi Jonathan,
You can override the markup of the form fields and make the necessary changes there to be compliant.
Depending on which version of Umbraco Forms you are using there are two different ways:
Views\Partials\Forms
folder as described here. The drawback of this older version is that your changes might be overridden when Forms gets upgraded to a newer version (hence why themes were introduced in v6).Hi,
Thanks for this - its really helpful and exactly what we are looking for.
Can I double check the ID of the Datepicker? it seems to be appending a _1 to the ID. Is it OK to swap this ID with the Hidden field or does the ID of the visible "input" field need to be the one with the Underscore? The reason for this is that the Label For Id has nothing to reference to and Total validator is throwing an accessibility error.
Thanks Jon
Hi Jonathan,
Yes, I think it does use it to set the hidden field value when the date changes. Have a look in the
Views\Partials\Forms\DatePicker.cshtml
view.But I guess you could change that bit of code to append the
_1
part instead, if you decide to swap the IDs round?Hello,
so I have modified Form.cshtml to change label instead of input view and accessibility pass the test
is working on a reply...