I currently have functionality on a page to give a user suggestions based on what they type in a text box (jquery suggest). The functionality I would like to add is to restrict what gets selected / entered into the text box to only be items in the list. Basically like a combobox which restricts its selections to what's in the list.
One thought I had is to verify that the entry in the textbox matches to an item in the list. I would have to alert the user that what is entered isn't allowed (or maybe there is a way to keep them typing other characters?), it's OK, but not real clean ui.
I figure someone on SO has done something like this; if someone has an idea to achieve this functionality please let me know.
The basic jquery I used:
<script type="text/javascript">
$(function() {
$('#autocomplete').autocomplete("getPcodes.aspx", { mustMatch: true, autoFill:true, multipleSeparator: "; ", minChars:3 });
});
</script>
There are a lot of nice options with the autocomplete. I was using a suggest jquery before, but I think I will opt for this one instead.