Locator Search from another page
-
Hello everyone.
I now that this problem was encountered in many topics before, but I am steel don’t find solution. I place this in default.js of my theme:
// zip code search (home page) jQuery(function ( $ ){ $('#wpsl-search-button-home').click(function() { var url = '/pages/location-search/?zip='; var inputURL = $('#wpsl-search-input-home').val(); window.location.href = url + inputURL; return false; }); }); // get parameter and post on location search jQuery(function ( $ ){ $.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); if (results==null) { return null; } else { return results[1] || 0; } } if ($.urlParam('zip')) { // set the default value of a text input field $('#wpsl-search-input').val(decodeURIComponent($.urlParam('zip'))); // delay and click button setTimeout(function(){ $('#wpsl-search-btn').click(); },5000); // In my case 5000 because I have many stores } });But I still don’t know what should be on index page (it would be the html code of input and submit button for redirect to the store locator page with search results)? The code like this is not working:
<div> <div class="wpsl-input"><input id="wpsl-search-input1" autocomplete="on" type="text" value=""></div> <div><a>Locate</a></div> </div>Please help me to find a solution of these problem.
Thanks in advanceP.S.Sorry for my English
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Locator Search from another page’ is closed to new replies.