Click here to Skip to main content
14,883,063 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:
function CreateAutoComplete(sourceArray, labelTextBox, idTextBox) {

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

        open: function (event, ui) {

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


        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:


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

Updated 10-Feb-15 22:55pm
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?
nina4ever 12-Feb-15 9:01am
sure i did. i decided to use another autocomplete plugin which uses bgiframe in its code. it just didn't work. cause i have no example how to use it
i need a demo, please

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

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