Search a URL description

June 10, 2019 at 04:17:57
Specs: Windows 10
I have some code I found on the internet that I've put into an HTML Form Web Part on a sharepoint site.

<script type="text/javascript">
    function RedirectUrl() {
        var tb = document.getElementById("tbSearch").value;
        var cs = document.getElementById("sfield").value;
        var url = "";
        if (tb != "") {
            if (cs == "URL") {
                url = "FilterField1=" + cs + "&FilterValue1=" + tb;
                window.location.href = "Test-3-SV.aspx?" + url;
            else {
                url = "FilterName=" + cs + "&FilterMultiValue=*" + tb + "*";
                window.location.href = "Test-3-SV.aspx?" + url;
        else {
            return false;
    function ClearUrl() {
        window.location.href = "Test-3-SV.aspx?";
        </script>Search Field: <select id="sfield">
         <option value="URL">URL</option>
         </select>   Search text: <input id="tbSearch" type="text"/>
         <input id="btnSearch" onclick="return RedirectUrl();" type="button" value="Search"/>
         <input id="btnClear" onclick="return ClearUrl();" type="button" value="Clear"/>

The code creates a search box that I've tweaked to search a URLs column I have in a sharepoint A-Z list.

The problem I have is that the list of URLs all have meaningful descriptions, rather than just displaying the URLs themselves in the A-Z list. Threfore the search works on the underlying URL, rather than the description. For example a value in the URL column might have a URL of "" but the description might be "Search Page".

Currently, if I enter "Search Page" into the search box, nothing is returned. But if I enter into the search box, "Search Page" is returned.

Is there a way to tweak the code so that I can search on the description, i.e. entering "Search Page" in the search box, rather than the URL itself?

message edited by ScottV

See More: Search a URL description

Report •
Related Solutions

Ask Question