Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Custom Search for a Custom Masterpage isn't passing querystring help please

$
0
0

I'm stuck, I can not figure out why the querystring isn't picking up the Search parameter.
here is the code it is a .js in the style library. it will connect the results page but  the parameter k is empty.
 I have tried this with a reference to  google  jquery link and with out. it will go the results page but the querystring item is blank in the url

masterpage code:

<div class="search-container">

<inputid="search-input" type="text"placeholder="Search..."onclick="this.value=''">

<iid="search-submit"class="material-icons">search</i>

</div>

JS File:

$(document).ready(function() {
          function inputSearch() {
                 var link = "";

                 $('#search-submit').click(function(event) {

                           event.preventDefault();

                           var queryString = $('#search-input').val();

                           // Make sure this location matches your site structure

                           var location = "/<site>/SitePages/results.aspx?u=#k=" + queryString;

                           link = location;

                           $('#search-input').attr("value", '');

                           window.location.href = link;

                           return;

                 });

          }

          inputSearch(); 

          $('#search-input').keypress(function(key) {

                 if($(this).is(":focus") && (key.which == 13)) {

                           $('#search-submit').click();

                 }

          });

    });





Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>