views:

51

answers:

0

I have a simple textbox and autocomplete like so:

<input id="tagQuery"  size="25" type="text" class="tagsearchbox" name="tagQuery"  style="vertical-align:middle" />
<script>$("#tagQuery").autocomplete("getAutoCompleteData.jsp");</script>

getAutoCompleteData is a jsp file containing JUST this (atm):

<%
    String query = request.getParameter("q");
    System.out.println(query);
%>

Now for whatever reason, it does not print to the console (or do any requests) until I have deselected the input box. So if I typed "abc" I would expect a, ab, abc on new lines.

Am I missing something?

Edit: It's not appearing on focus reliably. It just seems to run when it feels like it. I'm not polling the database, and it's running locally on a tomcat server.