Using 2 JQuery Autocomplete

Posted by Trike on Stack Overflow See other posts from Stack Overflow or by Trike
Published on 2010-03-24T10:09:41Z Indexed on 2010/03/24 10:13 UTC
Read the original article Hit count: 394

Hi All!

I am using the JQuery Autocomplete Plugin 1.1.

When I try to add autocomplete to 2 inputs in this way:

            $("#object_ac").autocomplete("autocomplete_search.php", {
            extraParams: {object:1},
                width: 160,
            selectFirst: false,
                minChars: 2
            });


            $("#id_norm_doc_ac").autocomplete("autocomplete_search.php", {
            width: 460,
            selectFirst: false,
                mustMatch: true                
            });

            $("#id_norm_doc_ac").result(function(event, data, formatted) {
                $("#id_norm_doc_add").val(data[1]);
            });

When #object_ac selected before #id_norm_doc_ac I get error after selecting one of suggestions in #id_norm_doc_ac:

data is undefined [Break on this error] data = elementToString(data.documentElement, true);

If I select #id_norm_doc_ac before other inputs, everything goes normal.

Thanks in advance for any assistance!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about jquery-plugins