I am trying to get my form to submit when a user either clicks enter or mouse clicks. I have seen some examples as well as the example on the jQuery UI site. The example that I am following is jQuery UI autocomplete submit onclick result. Therefore my code looks like this.
<script type="text/javascript"> $(document).ready(function() { $("#myInput").autocomplete({ source: "fh_autocomplete_search.php", minLength: 2, select: function(event, ui) { if(ui.item){ $("#myInput").value(ui.item.value); } $("#myInput").submit(); } }); $( "#myInput" ).bind( "autocompleteselect", function(event, ui) { }) }); </script> I'm not sure what should go under the .bind section of the code. Or really what it is even doing. And I have been here and read it but still just not clicking http://api.jquery.com/bind/ When I put an alert under it and select a ui.item from the #myInput box the alert does go off. But nothing fills or submits. If I put an alert under the if(ui.item) part it doesn't go off. If someone could explain to me what is going on and suggest some code to put under the .bind section I would greatly appreciate it.