Jump to content

keyboard select on autosuggest using jquery


funbinod

Recommended Posts

i'm trying to learn jquery. while learning i'm trying autosuggest and i tried this

<script type="text/javascript">	function lookup(inputString) {		if(inputString.length == 0) {			// Hide the suggestion box.			$('#suggestions').hide();		} else {			$.post("item.php", {queryString: ""+inputString+""}, function(data){				if(data.length >0) {					$('#suggestions').show();					$('#autoSuggestionsList').html(data);				}			});		}	} // lookup		function fill(thisValue) {		$('#inputString').val(thisValue);		setTimeout("$('#suggestions').hide();", 200);	}</script>

it is working properly... but i wish the suggestion could be selected using up and down arrows on keyboard. can anyone suggest how can i do that?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...