PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Google Lighthouse - Form elements do not have associated labels - Solved

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Google Lighthouse - Form elements do not have associated labels - Solved

    I thought I'd pass along something that was driving me crazy and I found an easy solution to. I was using Google Lighthouse to review my web pages and hopefully improve the scores. I couldn't get my accessibility score to 100 because I kept getting "Form elements do not have associated labels" for my Zoom search input. I'm using a font-awesome magnifying glass which apparently screen readers can't read. After a bunch of searching and trying all kinds of crazy ways I stumbled upon an easy solution. Just add Aria-label tag to your html. for example, <input type="text" id="zoom_searchbox" name="zoom_query" size="20" value="" class="zoom_searchbox" style="width: 130px;" aria-label="Search"/>. That's it, now I score 100.
    Here's a screenshot of the error I'm referring to:
    Click image for larger version

Name:	LighthouseError.jpg
Views:	212
Size:	74.5 KB
ID:	37524
    Zoom Search Engine 7.1 (Build: 1022) Professional Edition
    Windows Server, Apache, PHP
    Windows 10
Working...
X