I have the following jquery script which performs an auto complete search for my user when they type in the search bar like so:
<script>
$(function() {
var availableTags = [
"Telehandlers",
"Cranes",
"Fork Attachments",
"Aggreko",
"12 Tonne Telhandlers",
"Marwood",
"Crane Suppliers in Manchester",
"Total",
"Oil, Gas & Lubricants",
"Tomato Plant"
];
$( "#search" ).autocomplete({
source: availableTags
});
window.location.replace("search_results.php");
});
</script>
<input type="text" name="search" class="Search_bar_box" id="search">
So if they start typing in Telhandler this will auto complete and show in a drop down beneath the input text field which a user can click on, this then populates the search bar, what I want is if a user clicks on any of the words in the auto complete field for this to redirect the user to the search results page 'search_results.php' or when they have typed into the input field and hit enter.
The search result that user clicked on or typed in should some how get echoed onto the next page and the results displayed for that query.
I'm only a beginner here so not sure how I would do this, please could someone show me what I would need to do or point me in the right direction. Thanks in advance