Tiggles ツ
5/9/2018 - 2:57 PM

Custom goog search

Click on the search button or hit the enter key to query the search input in SW.

jQ171(function ($) {
  $('#custom-search-button').on('click', function () {
    window.location.href = '/SearchResults.aspx?s=' + $('#custom-search-field').val();
		return false;
  })
  $('#custom-search-field').on('keydown', function(e) {
    if (e.which == 13) {
      window.location.href = '/SearchResults.aspx?s=' + $('#custom-search-field').val();
      return false;
    }
  });
});

<div class="custom-search-panel">
	<input type="text" id="custom-search-field" placeholder="What are you looking for?" />
	<button type="button" id="custom-search-button">Search</button>
</div>