views:

19

answers:

0

Hi there. Pls I am using scriptaculous ajax autocompleter, and I am having difficulties trying to get it to do what i want.

You know when you start typing in the search form and a drop down list possible results start coming up, from that list I am trying to get it that when i click on one of the possible answers, it performs another search with the answer that was clicked on just like how Google does it. Pls help i am new to using php and codeignter. Here is my code:

<script type="text/javascript">
document.observe('dom:loaded', function() {
    new Ajax.Autocompleter('venue_name', 'autocomplete_choices',base_url+'home/ajaxsearch',{});
    $('venue_search_form').onsubmit = function(){
        inline_results();
        return false;
    }
});

function inline_results(){
    new Ajax.Updater ('venue_description', base_url+'home/search', {method:'post', postBody:'details=true&venue_name='+$F('venue_name')});
    new Effect.Appear('venue_description');
}
</script>