Click here to Skip to main content
15,889,804 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
dear all,

i am using JQuery UI v1.11.0

my autocomplete is working fine, except this case :

when i click on a menu item, "select" event is never fired, unless i click exactly on the text within the item.. only then the item is clicked, and "select" is fired

here is my code for creating autocomplete:
JavaScript
function CreateAutoComplete(sourceArray, labelTextBox, idTextBox) {

    $("#" + labelTextBox).autocomplete({ source: sourceArray,

        open: function (event, ui) {

            $(this).autocomplete("widget").find(".ui-menu-item").css({ "width": "300px" });
          
            $(this).autocomplete("widget").find(".ui-menu-item").bgiframe();

        },

 
        focus: function (event, ui) {
          
            $("#" + labelTextBox).val(ui.item.label);
            $("#" + idTextBox).val(ui.item.value);
            return false;
        },

        change: function (event, ui) {
            if (ui.item == null) {
                $("#" + labelTextBox).val("");
                $("#" + idTextBox).val("");
            }
        },

        select: function (event, ui) {
            $("#" + labelTextBox).val(ui.item.label);
            $("#" + idTextBox).val(ui.item.value);
            return false;
        } 

    });

    
   
} // function



if i comment out this line, autocomplete works fine, and "select" is fired on mouse click:

$(this).autocomplete("widget").find(".ui-menu-item").bgiframe();


but i need this line to solve the z-index issue of autocomplete on IE6...




thanx
Posted
Updated 10-Feb-15 22:55pm
v3
Comments
Can you create a fiddle at jsfiddle/?
nina4ever 11-Feb-15 7:23am    
no i can't.. the problem happens on IE6, and jsfiddle never opens on IE6.. so i can't create a fiddle to show you the problem..
What is labelTextBox?
nina4ever 12-Feb-15 6:53am    
when i create an autocomplete, i need a textbox for label, and a hidden field for id...
labelTextBox is a parameter which holds the ID of the textbox
If you search about "jquery + autocomplete + ie6" - you will get many results. Have you tried any solutions?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900