I tried, but it does not work. The sitaution I have is that user has a
radio button to specify under what context search is performed. As
user check the box, input field is put in focus, input value cleared,
previous autocomplete    removed and new one added. However, it does
not remove previous one, so depending on how many times radio button
is clicked, I get that many web service calls.


On May 7, 8:04 am, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> There is an unautocomplete-method.
>
> Jörn
>
> On Thu, May 7, 2009 at 3:03 PM, epitka <exptrade2...@yahoo.com> wrote:
>
> > Nobody knows how to remove plugin after it has been added?
>
> > On May 6, 4:04 pm, epitka <exptrade2...@yahoo.com> wrote:
> >> Hi,
> >> How do I remove autocomplete from the text box dynamically. I have a
> >> text box that will perform two kinds of searches depending on the
> >> context (don't ask me why, beyond my control). I need to remove
> >> previous autocomplete and attach new one. Difference is in the url
> >> that it goes against. Or maybe there is a way to change Url and some
> >> options dynamically?
> >> I've been trying this with no luck. It just keeps adding new
> >> autocompletes. This is markup after binding in aspx page.
>
> >>     $("#rbClientName").click(
> >>                 function() {
> >>                     debugger;
> >>                     $("#ctl00_mainBody_txtClientNumber").unbind
> >> ("autocomplete");
> >>                     //clear text and focus
> >>                     $("#ctl00_mainBody_txtClientNumber").val("").focus
> >> ();
> >>                     //attach autocomplete to txtClientNumber text box
> >>                     $("#ctl00_mainBody_txtClientNumber").autocomplete
> >> ('ws://../WebServices/ClientSearch.asmx/GetClientNameSearchResults', {
> >>                         multiple: false,
> >>                         minChars: 3,
> >>                         max: 100,
> >>                         mustmatch: true,
> >>                         scroll: false,
> >>                         highlight: function(value, term) { return
> >> value; },
> >>                         formatItem: function(item) {
> >>                             return format(item);
> >>                         }
> >>                     })

Reply via email to