tags:

views:

14

answers:

1

Hi everyone, I need some help in jquery. I am using autocomplete plugin, I want to send the id of the box as the parameter in js code but not sure the syntax please help me out:

function suggestName(id)
    {
        //this some help here.....
        $('#'+id).autocomplete("dealer_live.php",{
        width: 150,
        selectFirst: true
        }); 
    }
    $(document).ready(function(){
    alert("");
        suggestName();
    });
    </script>

</head>
<body>
    <form>
    <div>
        <input type="text" id="inputName" onKeyUp="suggestName('inputName')" />
    </div>
    </form>
</body>
A: 
suggestName('inputName');

?

You also don't need onKeyUp handler: plugin will take care of it.

Nikita Rybak
Yes I know the plug in will do, but the problem is now i have 3 search boxes, calling one PHP file, and in one PHP file I will refine the search type by verify the ID of the box. If I use this way together with the plugin, I cannot go down the list by pressing down button because each time i press it will call the function again, and the selected item always at the top. I've been thinking for 2 days already, still cannot get the best solution. I do not wish to write 3 different PHP processing files because it looks kinda stupid. Please help me if you have any other idea.
LAT