html - Using aria-invalid on divs representing input -
i working on site asks users upload items validation. make output of upload accessible, unclear whether or not acceptable set aria-invalid
on div
when div represents user input (as opposed being valid on input elements).
yes, correct use aria-invalid
element contains user input if value of element has been or checked correctness. value of attribute, defined in aria spec, should set according result of check, aria-invalid=true
if test fails.
the use of attribute not limited form fields. in fact, in them, unnecessary @ least in principle if html5 checks performed, since assistive software can have access results (though not happen), whereas checks performed client-side javascript invisible assistive software unless signal results aria attributes.
a typical scenario div
element has contenteditable=true
attribute , acts advanced user input area, checks on content.
if div
element merely echoes user input (e.g., user input has been taken via normal form , server-side form handler has checked , sent page containing error messages , copies of user input), it’s debatable. seems case aria attributes not meant used. instead, error messages should indicate errors , relate them user input. there no need aria-invalid
—unless div
element user-editable , acts input area, too.
Comments
Post a Comment