Jump to content

Search problem


besly98

Recommended Posts

Hi All,

 

i have used the following code on this tutorial,

http://www.jeffadams.co.uk/2009/08/31/auto-suggest-with-php-jquery/

 

but when im querying my database, i need to send through another value as well as the search value.

 

So basically i need to  send 2 values through to the search page. I have tried many options but cant get this to work. Any ideas?

 

Thanks

 

Link to comment
https://forums.phpfreaks.com/topic/214173-search-problem/
Share on other sites

 <form>
<div>
<h3>Band Name</h3>
<input type="text" size="30" value="" id="inputString"
onkeyup="lookup(this.value);" onblur="fill();" />
</div>
<!-- hide our suggestion box to begin with-->
<div class="suggestionsBox" id="suggestions" style="display: none;">
<img src="upArrow.png" style="position: relative; top: -18px; left: 30px;" alt="upArrow" />
<div class="suggestionList" id="autoSuggestionsList"></div>
</div>
</form>

function lookup(inputString) {
if(inputString.length == 0) {
// Hide the suggestion box.
	$('#suggestions').hide();
} else {
// post data to our php processing page and if there is a return greater than zero
// show the suggestions box
$.post("string_search.php", {mysearchString: ""+inputString+""}, function(data){
 if(data.length >0) {
 	$('#suggestions').show();
		$('#autoSuggestionsList').html(data);
}
});
}
} //end

// if user clicks a suggestion, fill the text box.
function fill(thisValue) {
$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').hide();", 200);
}

 

so basicaly i need to pass 2 bits of data to the submit form. but i cant get it to work. this is the original code.

Link to comment
https://forums.phpfreaks.com/topic/214173-search-problem/#findComment-1114434
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.