How do I add a label to the livesearch macro html?

Jeremy Swan October 16, 2019

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>

 

2 answers

0 votes
Jeremy Swan October 22, 2019

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?

Jeremy Swan October 22, 2019

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.

Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 23, 2019

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:

Specifically, this:

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

Jeremy Swan November 5, 2019

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.

0 votes
Shannon S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 22, 2019

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 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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events