WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Required and/or aria-required in Form Controls

for

From: Patrick H. Lauke
Date: Jul 6, 2015 8:27AM


On 06/07/2015 15:22, Paul J. Adam wrote:
> You can use aria-required if you only want to indicate required state
> to the Accessibility API but don't want to use browser native input
> validation.
>
> Use HTML5's required attribute to indicate state and also use the
> browser validation e.g. <input type=email> makes the user type
> something that looks like an email to be valid.

Just on the topic of native validation on the part of the browser: if
for some reason you want to suppress native validation (for instance, if
a form offers both a "Submit" and a "Save for later..." button, and with
the latter you'd expect some required etc. fields not to be filled in
yet) you can use the novalidate (on the <form>) and/or formnovalidate
(on the submit <input>) attributes
http://www.w3.org/TR/html5/forms.html#attr-fs-novalidate

P
--
Patrick H. Lauke

www.splintered.co.uk | https://github.com/patrickhlauke
http://flickr.com/photos/redux/ | http://redux.deviantart.com
twitter: @patrick_h_lauke | skype: patrick_h_lauke