« Back
You are in :
Recent Topics »
Using jQuery »
How to Attach This Autocompleter to This... [SOLVED]
I found the answer. It's very cool. You just drop out the keyup code and replace it with the observer code:
$(document).ready(function()
{
$('#searchterm').delayedObserver(0.5, function(value, object)
{
//controller's URI
var theSearchString = $("#searchterm").val();
var url = '/ajaxsearch';
$("#search-results").load(url, {searchterm: theSearchString},
function()
{
var htmlStr = $("#search-results").html();
if(htmlStr == '')
$('#search_results_header').html("<p>Items will appear here when you search. </p>");
else
$('#search_results_header').html("<p><i>Please <b>confirm</b> your selection by clicking it:</i></p> </p>");
});
});
});
Awesome. Thanks for posting the answer!
Post Actions


