Your question also appears to be a common request on the jQuery plugin forum and in How to implement “mustMatch” and “selectFirst” in jQuery UI Autocomplete people have been discussing this issue.
The accepted answer for this question works. So Doc Hoffiday's solution really deserves the reputation points.
Alternatively you could use Jörn Zaefferer's autocomplete with the "mustMatch" option.
<script type="text/javascript">
$(document).ready(function(){
var availableTags = ["csharp", "java", "python"];
$("#tags").autocomplete(availableTags, {
mustMatch: true
});
});
</script>
<input id="tags" />
UPDATE
Initially, I had missed that you wanted a combobox solution. Thanks for making that clearer.
I have tweaked the combobox example.
I needed to make a few changes to make it actually work within a form. I introduced a short delay to ensure that the events happened in the right order. Other than that I inserted Doc Hoffiday's solution.
I used a "change" event, but you might also be able to get something working using the "close" event. I hate to say it, but my experience so far of working with the new jQuery UI autocomplete is that it is a bit unreliable. Things seem to mess up when you have more than one type of event callback configured.
UPDATE 2
I added a new custom selector based on Doc Hoffiday's solution so that the entered text is not overwritten when it matches the beginning of valid option. I have also updated it so that the source to restrict the options offered to more exact matches. I hope this is closer to your requirements.
I have tweaked my previous combobox example.