On Fri, Sep 29, 2017 at 7:16 PM, Walden Raines <[email protected]> wrote:
> Hey everyone, > > I would like to propose that we establish a requirement that all new form > inputs include both a unique ID attribute and a <label> like so: > > <label for="name">Name:</label> > <input id="name" type="text" name="name"/> > > For form fields where the is no label we should use bootstrap's .sr-only > class on the label to hide it like so: > > <label for="name" class="sr-only">Name:</label> > <input id="name" type="text" placeholder="Name:" name="name"/> > > This allows screen readers to relate a label field to an input in a > meaningful way making it easier for the visually impaired to use our > application (as an added bonus unique input IDs also allow for easier to > write and maintain QA automation). It is important that the ID be unique > to the page so as not to confuse screen readers and also in order to > produce valid HTML. > > Please help this effort by keeping an eye out for new input fields that > on't have IDs and labels and if you happen to notice an input without an ID > and label please fix it. > In foreman, its all going though a single code path, so a simple change to > > https://github.com/theforeman/foreman/blob/develop/app/helpers/form_helper.rb#L326 > will get what you are looking for. > See also [1]. > > Thanks, > Walden > > [1] https://webaim.org/techniques/forms/controls#input > > -- > You received this message because you are subscribed to the Google Groups > "foreman-dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "foreman-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
