Hi ,
you have to make a little changes in autocomplete.js

Search for "*if (data && data.length*)" condition which is inside "request"
function. Add this code before the *if * condition

if(data)
    data.length=0;



On Tue, Jul 28, 2009 at 1:29 PM, Vivek <narula.vi...@gmail.com> wrote:

>
> Hi,
>
> I am using autocomplete plugin. I have one Search field upon which i
> have put the autocomplete and other a select box which have 3-4 values
> such as Vidoes, audios, images etc...,
>
> I am using Extrafield option to pass the select box's value to the PHP
> Script. It is working fine however i am having one problem.
>
> IF i select vidoes in the select box and enter "a" it autocompletes
> and shows  the results from the database. if i add "b" to it therefore
> the search keyword becomes "ab" it works fine. Now at this stage if i
> change "Videos" to "Audios" in the dropdown and remove "b" from the
> search keyword therefore the search keywords becomes "a" with select
> box having Audio, It shows the same results that it was showing for
> the "Videos" select box.
>
> I have seen (with Firebug) there no Ajax Calls happens. So it seems
> that it is using cache. I tried to use flushCache function of
> autocomplete however it did not works. Below is the code i am using.
>
>
> jQuery(document).ready(function (){
>        jQuery("#searchfield").autocomplete("autosearch.php", {
>                width:150,
>                autoFill:false,
>                matchContains: true,
>                extraParams: {
>                                        searchtype: function (){return
> jQuery('#searchtype').val();}
>                                                },
>                selectFirst: false
>        }).flushCache();
>
> });
>
> Please suggest me any solution for it.
>
> Thanks

Reply via email to