ajax tool kit Autocomplete dropdown usage with asp

2019-09-14 16:21发布

问题:

I have an Ajaxtool kit AutoComplete extender control that targets to a Text box. I am calling a web service and returning the values to bind to the AutoComplete extender and that works great.

Now if the user selected a value from the autocomplete dropdown the targetted text box populates it, but if the user typed in a value in text box, and if that value is in the autocomplete dropdown then its fine to retain that value, but if the user types in any other value in the text box which is not in the auto complete dropdown, then on blur of the text box the user typed in value should be cleared. This is the UI Condition. I am not sure what code to write in onblur() of the text box. Any help would be appreciated.

回答1:

This issue got resolved. I saved the webservice results in a hidden filed and onblur of the textbox, I compared the value entered in the text box with the list present in the hidden field.