Quicknote: Hiding "Narrow The Search" from advanced search

I had to hide the “narrow the search” box from the advanced search, due to it only containing one field. I could not do this via the standard webpart properties, due to needing to see specific criteria below. To do this, I wrote a (pretty horrible) bit of JS, and added it to a content editor webpart with no chrome below the advance search webpart
<script language=”javascript”>
var arr = document.getElementsByTagName(“h3”);
for (i = 0; i < arr.length; i++)
   if (arr[i].className == ‘ms-standardheader’ && arr[i].innerText == ‘Narrow the search…’)
var parentRow = arr[i].parentNode.parentNode;
        // Hide this row and next three rows
        parentRow.style.display = ‘none’;
        parentRow.nextSibling.style.display = ‘none’;
        parentRow.nextSibling.nextSibling.style.display = ‘none’;
        parentRow.nextSibling.nextSibling.nextSibling.style.display = ‘none’;

You May Also Like

About the Author: rnowik

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.