Hey Dan,

I am playing around with your suggestions below on how to implement
multiple autocomplete calls on one form using your implementation. I
have added the second argument (input) in the callback as you
suggested, but am stumped about where in the code to pass the input
reference from? I have tried the onFindValue argument in the
autocomplete call, but that is not working.  I am getting 'input is
not defined' errors and have not yet been able to trigger an alert
box.

Any clues?

>
> What you could do is look through the callbacks in the source code and add
> the "input" variable as a second argument. So for example, you'd change the
> line:
>
> if( options.onFindValue ) setTimeout(function() { options.onFindValue(li) },
> 1);
>
> To:
> if( options.onFindValue ) setTimeout(function() { options.onFindValue(li,
> input) }, 1);
>
> This would pass a reference to the current input DOM element, so you could
> do:
>
> if( input.id == "unit_lookup" ) alert("Ok, do something!");
>
> This would also allow you to attach the behavior to multiple elements w/the
> same call.

Reply via email to