in2code-de / powermail

This is the official repository of the TYPO3 extension powermail! Powermail is a well-known, editor-friendly, powerful and easy mailform extension for TYPO3
https://in2code.de
88 stars 176 forks source link

Add aria-required="true" #293

Closed schi closed 6 years ago

schi commented 6 years ago

Our website was testet by https://access-for-all.ch/ch/. A finding was that we have to mark required fields not only with a *.

In powermail/Classes/ViewHelpers/Validation/ValidationDataAttributeViewHelper.php go to function addMandatoryAttributesForMultipleFields(array &$additionalAttributes, Field $field, $iteration)

and add aria-required="true" to required fields for better accessibility.

einpraegsam commented 6 years ago

Can you please provide an official documentation where the benefits of aria-required are described?

schi commented 6 years ago

From https://www.w3.org/Translations/WCAG20-de/#minimize-error 3.3.2 Beschriftungen (Labels) oder Anweisungen: Wenn der Inhalt eine Eingabe durch den Benutzer verlangt werden Beschriftungen (Labels) oder Anweisungen bereitgestellt. (Stufe A)

Some modern screen reader understand HTML5 attribute required. Older doesn't but understand aria-required.

einpraegsam commented 6 years ago

Ok, accepted. Do you like to do a pull request?

schi commented 6 years ago

Yes I'll try to do my first pull request.

einpraegsam commented 6 years ago

Thx for the PR. Some fixes are still needed and then I will accept it. Nevertheless I will close this issue for now (of course the PR is still open).