Autocomplete and change event
I'm having an issue where the change event only seems to fire when the length of my input is greater than 0 and less than minLength.
Here's my code:
- <script type="text/javascript" src="http://jqueryui.com/latest/jquery-1.4.2.js"></script>
- <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/tags/1.8rc1/jquery-1.4.1.js"></script>
- <script type="text/javascript" src="http://jquery-ui.googlecode.com/svn/tags/1.8rc1/ui/jquery-ui.js"></script>
- <script language="JavaScript" type="text/javascript">
- $(document).ready(function() {
- $("#playerSearch").autocomplete({
- change: function(event, ui) {
- alert("*");
- },
- source: function(request, response) {
- $.ajax({
- url: '<%=ResolveUrl("~/Player/Search")%>',
- dataType: "html",
- data: {
- query: request.term
- },
- success: function(data) {
- $('#playerResults').html(data);
- },
- error: function() { alert('error'); }
- })
- },
- minLength: 2
- });
- });
- </script>
- <div>
- <input type="text" id="playerSearch" style="width: 75px; margin-left: 10px; margin-top: -10px;" />
- <div id="playerResults"></div>
- </div>
-
Any thoughts? Again, I only get the * alert when the input text changes to 1 character in length.