I'm using the JQuery auto complete ( jquery.autocomplete.js ). and I'm wondering how can I submit a form once an item has been selected? currently when an item is select you have to hit enter twice, once to get the item into the search field, and once to submit the search. I'd like to submit the search on the first enter or when an item selecting by mouse.
how can I use this to submit the form???? This is my code::
$(function() {
$("#artist" ).autocomplete({
source: function( request, response ) {
$.ajax({
url: "http://",
dataType: "jsonp",
data: {
results: 12,
format:"jsonp",
name:request.term
},
THis is the form::
<form id="mainSearchForm" onSubmit="ytvbp.listVideos(this.queryType.value, this.searchTerm.value, 1); document.forms.searchForm.searchTerm.value=this.searchTerm.value; ytvbp.hideMainSearch(); document.forms.searchForm.queryType.selectedIndex=this.queryType.selectedIndex; return false;">
<div align="left">
<select name="queryType" onChange="ytvbp.queryTypeChanged(this.value, this.form.searchTerm);">
<option value="all" selected="true">All Videos</option>
<option value="top_rated">Top Rated Videos</option>
<option value="most_viewed">Most Viewed Videos</option>
<option value="recently_featured">Recently Featured Videos</option>
</select>
<input name="searchTerm" id="artist" >
<input type="submit" value="Search">
</div>
</form>