Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance form functions for accessibility #6976

Open
lizardat opened this issue Mar 7, 2024 · 9 comments
Open

Enhance form functions for accessibility #6976

lizardat opened this issue Mar 7, 2024 · 9 comments
Labels

Comments

@lizardat
Copy link

lizardat commented Mar 7, 2024

Description

Contao already provides a very good base for accessible websites. To further enhance the possibilities, I would suggest these additions to the form module:

autocomplete

One criteria for accessible websites is the usage of "autocomplete" with input fields in forms.

It would be great help if the backend offers a select field for autocomplete for <input>, <select> and <textarea>. Possible options are listed at https://www.w3.org/TR/WCAG21/#input-purposes

<form> should get the choice of options autocomplete=on/off

novalidate

Furthermore, <form> should be able to get "novalidate" to prevent validation of the form input by browsers but leave the validation fully to the settings from Contao.

aria in case of error

input fields should get a aria-describedby connected to the error message in case of an validation error.

Error messages should be marked with role="alert" and aria-live="assertive"

@fritzmg
Copy link
Contributor

fritzmg commented Mar 7, 2024

novalidate

Furthermore, <form> should be able to get "novalidate" to prevent validation of the form input by browsers but leave the validation fully to the settings from Contao.

This you can already configure in the form's settings. Though why would you enable that for the purpose of accessibility?

@lizardat
Copy link
Author

lizardat commented Mar 7, 2024

Browser validation is sufficient for WCAG 2.1 3.3.1 Error Identification

If an input error is automatically detected, the item that is in error is identified and the error is described to the user in text.

but does not provide enough information as requested in 3.3.3 Error Suggestion

If an input error is automatically detected and suggestions for correction are known, then the suggestions are provided to the user, unless it would jeopardize the security or purpose of the content.

@asaage
Copy link

asaage commented Mar 7, 2024

Browser validation is sufficient

Funfact: chromes validation accepts mail@example (without a tld) in <input type="email">

@fritzmg
Copy link
Contributor

fritzmg commented Mar 7, 2024

but does not provide enough information as requested in 3.3.3 Error Suggestion

In what way does the browser validation not provide enough information?

@aschempp
Copy link
Member

aschempp commented Mar 7, 2024

Funfact: chromes validation accepts mail@example (without a tld) in <input type="email">

Because that is a valid email address... e.g. you@localhost

@asaage
Copy link

asaage commented Mar 7, 2024

Because that is a valid email address

Yep - but contao wont't like it.

@fritzmg
Copy link
Contributor

fritzmg commented Mar 7, 2024

@asaage pls discuss this in a separat issue, not here.

@lizardat
Copy link
Author

lizardat commented Mar 7, 2024

In what way does the browser validation not provide enough information?

Because "Feld ausfüllen" ist not sufficient help to correct errors,
see https://www.w3.org/WAI/WCAG20/Understanding/error-suggestion

@fritzmg
Copy link
Contributor

fritzmg commented Mar 7, 2024

Because "Feld ausfüllen" ist not sufficient help to correct errors,
see https://www.w3.org/WAI/WCAG20/Understanding/error-suggestion

If you think this is not enough (I don't really see why that would be the case from your provided link) then this is something you should report to the respective Browser vendors. Generally I do not see how disabling browser validation increases accessibility as the browser can help the user better and more immediately (with enough information provided). In any case as per your original request and as already mentioned - this is something you can already do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants