Hello,

You will have to bind autocomplete to newly added input elements.
Alternatively, consider binding the autocomplete as the last operation
(after the form is completely prepared). That way you can save on some glue
code. And dont bind two autocomplete operations on an input element, as it
recreates the bindings.

On Sun, Jan 25, 2009 at 1:47 AM, Toaster <mr.toas...@gmail.com> wrote:

>
> Hello
>
> I am currently using a autocomplete plugin which is working on a
> single static input. I currently have jQuery creating new inputs and
> I'd like to have the autocomplete on work then as well. Im not too
> familiar with javascript or jQuery but, I think since the inputs are
> created after the "$().ready(function()", the autocompleter doesnt
> work.
>
> I have figured out a way to make it work but I dont think it is the
> best way. Here is what I am doing:
>
> ----------------------------------------------
> $().ready(function() {
>
>        $(".inputs").autocomplete("ajax/inputs_query/", {
>                width: 360,
>                selectFirst: false,
>                formatItem:formatItem
>        });
>
> });
> ----------------------------------------------
>
> then within the function that appends the inputs, right after the
> append. I just have it do (again):
>
> ----------------------------------------------
>        $(".inputs").autocomplete("ajax/inputs_query/", {
>                width: 360,
>                selectFirst: false,
>                formatItem:formatItem
>        });
> ----------------------------------------------
>
> Is there a better way to this?
>
> Thanks




-- 
Thanks
Ram

Reply via email to