Hi,
Does anybody know how using AutoCompleteExtender (from AJAX Control Toolkit) prevent user from entering anything not in suggested values?
Hi,
Does anybody know how using AutoCompleteExtender (from AJAX Control Toolkit) prevent user from entering anything not in suggested values?
First, check if you would rather use the new AjaxToolKit ComboBox.
If you can't (for example, if you're using .NET Framework 2.0), you can manipulate the AutoComplete to answer your demands but it's a headache and not really what the control was made to.
The checks are supposed to be made inside the javascript, you add an event to catch OnItemSelected.
And then create a function:
function OnItemSelected (sender, e)
{
-- validate here
}
Another option is to require user to choose value from list by manipulating the events:
onchange, onclick & onblur. But it takes some time to find just right combination.
To lift your spirits I'll tell you that it is possible (we've done it, but I can't attach our code because of copyright issues).