title: how to prevent default select event in autocomplete jquery
body: <p>The jQuery Autocomplete docs for the <a href="https://api.jqueryui.com/autocomplete/#event-select" rel="nofollow noreferrer"><code>select( event, ui )</code></a> option say:</p>
  <blockquote>
  <p>Triggered when an item is selected from the menu; ui.item refers to
  the selected item. The default action of select is to replace the text
  field's value with the value of the selected item.</p>
  <p>Cancelling this event prevents the value from being updated, but does
  not prevent the menu from closing.</p>
  </blockquote>
  <p>So how do I cancel the event? Here's my code.</p>
  <pre><code>$(&quot;#txt1&quot;).autocomplete({
      minLength: 1,
      source:  &quot;abc.php&quot;,
      select: function(event, ui) 
      {
          event.preventDefault();
          //alert(&quot;Select&quot;);
          var label= ui.item.label;
          var value= ui.item.value;
          $('#txt1').val(ui.item.label);
      }
  });
  </code></pre>