javascript - Search form: submit when a name is clicked -
in search box, when user presses 3 letters, list of potential hits shown.
but when user selects name list, still has press enter. how can avoid when selects name, name should automatically submitted.
update: , possible submit when user selects name list, , not when presses enter?
this html code:
<form action="10_miles.php" method="post"> <p><label>please enter last name , find name in list: </label><br><br> <input type='text' name='full_name' value='' class='auto'></p> </form>
i making use of javascript:
<script type="text/javascript"> $(function() { $(".auto").autocomplete({ source: "search_develop.php", minlength: 3 }); }); </script>
you like;
<script type="text/javascript"> $(function() { $(".auto").autocomplete({ source: "search_develop.php", minlength: 3, change: function (event, ui) { $('form').submit(); }, close: function (event, ui) { $('form').submit(); } }); }); </script>
Comments
Post a Comment