Hi Guys!

I am currently using the Autocomplete plugin by Jörn and its awesome!
However, I have problem when I try to use multiple autocompletes in
one page.

There is one <input>.

I bind it when “document.ready” fires. It’s works perfectly.

function BindAutosuggestControl(id, urlAction, resultId, formatFunc,
parseFunc, selectFunc) {

      $("#" + id).autocomplete(appRoot + urlAction + '/', {
          dataType: 'json',
          minChars: 1,
          matchSubset: 1,
          autoFill: true,
          matchContains: 1,
          cacheLength: 0,
          selectFirst: true,
          formatItem: formatFunc,
          maxItemsToShow: 10,
          parse: function(data) {
          return parseFunc(data)
         }
});
    $("#" + id).result(function(event, data, formatted) {
    selectFunc(event, data, formatted, resultId);
    });
}

Then, user clicks “add another action”

I cloned this “input”, set a new id (“action2”) (if user clicks again,
cloned first and set to new input the new id “action3” etc)

Then, I call BindAutosuggestControl(“action2”, ……) etc. It works fine
in Firefox/Safari - no problems at all. User can type characters, and
plugin will show him autossuggestions, user can select value etc.

In Internet Explorer 7 it works only for one input box. For other
boxes plugin downloaded data from server and show it to user, but user
can’t select any values! It select randomly first or second values
(when press “Down Arrow”). But, if we use “mouse” to select value it
selects correctly

I have tried everything and just can't seem to fix this issue! Can you
please help ?

Thanks!

Reply via email to