If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Google Lighthouse - Form elements do not have associated labels - Solved
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: