title: Jquery search on enter with autocomplete
body: <p>I've got some JQuery which works fine.  It loads all the autocomplete values, and upon clicking them, they load the searchdata.php which performs all the searching.  This works.</p>
  
  <p>What I can't figure out is, if the user decides they don't want to select an autocomplete value and hit enter instead, how do I get it to perform the searchdata.php on the value that is in the search input upon hitting enter WITHOUT reloading the page?  I've tried bind and live and can't get it to work.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  
  var availableTags = &lt;?php echo json_encode($findrow);?&gt;;
  
    $("#search_input").watermark("Begin Typing to Search");
    $('#searchresultdata').append(sendSelected);
  
      $("#search_input").autocomplete({
          source: availableTags,
          select: function(event, ui) {
            sendSelected(ui.item.value);
            }
          });
  
  function sendSelected(_val){
      var search_input = _val;
      if (search_input =='') search_input ='*';
      var dataString = 'keyword='+search_input;
  
      if (search_input.length &gt; 2 || search_input=='*') {
         $.ajax({
              type: "GET",
              url: "core/functions/searchdata.php",
              data: dataString,
              success: function(server_response) {
                  $('#searchresultdata').empty();
                  $('#searchresultdata').append(server_response);
                  $('span#category_title').html(search_input);
              }
          });
      }
  }
  });
  &lt;/script&gt;
  </code></pre>