You're binding the autocomplete on keyup, which binds another keyup
event - every time. Remove your inline event handler and initialize
the autocomplete just once on document ready.

Jörn

On Mon, Aug 25, 2008 at 4:52 PM, kreiss <[EMAIL PROTECTED]> wrote:
>
> Following the documentation, it seems I'm doing it correctly...I'm
> getting data back from my database, but I just have to click out of
> the textbox first before I see the data, other than that it works
> great.
>
> Jörn Zaefferer wrote:
>> Please take a look at the examples here:
>> http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/
>>
>> The "remote" examples are based on PHP, but still show the essential
>> stuff. You've got it all mixed up.
>>
>> Jörn
>>
>> On Fri, Aug 22, 2008 at 9:57 PM, kreiss <[EMAIL PROTECTED]> wrote:
>> >
>> > I'm close to getting the autocomplete to finally work...but.....
>> >
>> > First of all, I'm using Java / .jsp to query a database for results
>> >
>> > I'm sending the url to my servlet, my servlet passes the data back to
>> > the .jsp page....Nothing appears in my dropdown UNLESS I use my mouse,
>> > click outside of the textbox and then click back into it.  Then the
>> > autocomplete works great and displays the data from the database
>> >
>> > I've tried IE, Opera, Firefox and everyone of them requires me to
>> > start typing in the text box, click out, click back in then the
>> > autocomplete displays.
>> >
>> > Is this a bug or am I'm doing something wrong.
>> >
>> > I've read something in this form about a guy wanting to know if there
>> > was a "reinitialize" function that could be called in the javascript
>> > once the data was brought back from the servlet...I didn't see a
>> > solutions, but think maybe this is what I need.
>> >
>> > Here is sample code:
>> >
>> > //JavaScript Code
>> > function getNames()
>> > {
>> >      $("#name").autocomplete("employeedirectory?command=ajax&q=" +
>> > document.forms[0].test.value + "&        limit=10");
>> > }
>> >
>> > //HTML
>> > Name:
>> > <input type="text" id="name" onkeyup="getNames()
>> >
>> > Thanks in advance
>> >
>> >
>> >
>> >
>

Reply via email to