This is the html plus js script. It actually submits the form but with the empty field value
<form id=my_form name=Form size=30 action=/search.php method=post>
<div id="suggest"><br />
<input id=country maxlength=30 type=text name=key value="" onkeyup="suggest(this.value);" onblur="fill();" class="">
<div class="suggestionsBox" id="suggestions" style="display: none;">
<div class="suggestionList" id="suggestionsList"> </div>
</div>
</div>
<input type=submit value='Search'>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js"></script>
<script type="text/javascript" language="JavaScript">
function suggest(inputString){
if(inputString.length == 0) {
$('#suggestions').fadeOut();
} else {
$('#country').addClass('load');
$.post("autosuggest.php", {queryString: ""+inputString+""}, function(data){
if(data.length >0) {
$('#suggestions').fadeIn();
$('#suggestionsList').html(data);
$('#country').removeClass('load');
}
});
}
}
function fill(thisValue) {
$('#country').val(thisValue);
setTimeout("$('#suggestions').fadeOut();",100);
$('#my_form').submit();
}
</script>