How do I add a label to the livesearch macro html?
Asked by Jeremy Swan:

I need to add a label to the html form, which is produced by the livesearch macro to make the page accessible/508 compliant: <https://www.w3.org/WAI/tutorials/forms/labels/>

Example of what could be added: \<input type="text" name="search" aria-label="Search"\>

Current Code produced by livesearch which is missing the "search" label:

\<div class="search-macro search-macro-medium"\>  
\<div class="aui-dd-parent"\>\</div\>  
\<form class="aui aui-dd-parent" name="livesearchForm" method="POST" action="/confluence/dosearchsite.action" _lpchecked="1"\>  
\<fieldset class="search-macro-fields"\>  
\<div class="search-macro-query"\>  
\<input class="text" type="text" name="queryString" autocomplete="off" placeholder="Search"\>  
\</div\>  
\<button type="submit" class="search-macro-button aui-button"\> \<span class="aui-icon aui-icon-small aui-iconfont-search"\>Search\</span\> \</button\>  
\<input type="hidden" name="where" value="IRBO"\>  
\<input type="hidden" name="additional" value="space name"\>  
\<input type="hidden" name="labels" value=""\>  
\<input type="hidden" name="contentType" value=""\>  
\</fieldset\>  
\</form\>  
\</div\>


Answers:
author: Jeremy Swan
body: Hi Shannon.

I don't know how to be more clear that I am not talking about confluence labels. I'm talking about the Label Element in the html that is produced by the livesearch macro, which I have pasted into my original comment and posted a direct link to w3c page which discusses the label element.

This happens on all versions of confluence, which you can see if you enter any confluence site into the web accessibility evaluation tool here: WAVE AIM: <https://wave.webaim.org/>

You'll notice an error for the search box that the label (html label) is missing, so the search doesn't meet accessibility requirements and would actually be very very easy for Atlassian to fix. I wasn't sure if there is a way to modify the source code by the end user (me), or release a new livesearch macro plug-in as a work around. any other options I'm missing?

comments: author: Jeremy Swan
body: I'm not talking about creating a form. When the LiveSearch marco is used, either in a page or with a tool like Adaptavist Theme Builder, it creates html code, which users view in their browser. If the html code is viewed directly (I pasted it in question), one can see that it's a "form" since a user would fill in the form (a search term) and then click submit to submit the form. What I'm saying is that Atlassian needs to add a Form Label to the Form which confluence creates via Livesearch. This has nothing to do with Atlassian Labels or restricting a search to a label. I understand how that could be confused with form labels. Sorry if I sounded irritated. I recently quit nicotine and am too easily irritable sometimes! I'm working on it. Thank you Shannon.


author: Shannon S
body: Jeremy,

Thank you so much for taking the time to verify that with me. We have the threads below to track Confluence section 508 compliance implementation, which would include your request:

* [CONFSERVER-12383](https://jira.atlassian.com/browse/CONFSERVER-12383) *Section 508 Compliance for Confluence (VPAT)* (Server)
* [CONFCLOUD-12383](https://jira.atlassian.com/browse/CONFCLOUD-12383) (Cloud version)

Specifically, this:

* [CONFSERVER-54041](https://jira.atlassian.com/browse/CONFSERVER-54041) *Section 508 - Missing Form Labels*

Although each request is broken down into a separate request, the best one to vote on and watch is the primary section 508 request.

Thank you again for your time and best of luck with quitting!

Regards,

Shannon


author: Jeremy Swan
body: Thanks, I voted for the issues. I'm also looking into replacing the search with a custom search using search.gov instead of confluence's livesearch macro. We'll lose internal searching, but you can add the label for 508 compliance and can also get search analytics.


author: Shannon S
body: Hello Jeremy,

Welcome to Atlassian Community. It's nice to meet you.

Can you help me to understand what you're trying to do here? You can add a label to the parameters of the [Livesearch Macro](https://confluence.atlassian.com/doc/livesearch-macro-163415902.html) in order to limit your search results to a specific label. However, I'm not really sure what you are referring to when you mention the HTML form.

Is there a specific add-on you're using to create a form in Confluence, and you want to use it in conjunction with the Livesearch Macro? Where will you be entering this code?

Lastly, please confirm your Confluence version so we can refer to it if we have any issues.

Regards,

Shannon


Tags: accessibility

atl-adm

confluence-server

http-error

live-search

server