开发者

textbox autosuggest in asp vb

The application is written in ASP VB classic and various Java scripts. I am faced with some issues

1) When I select an entry in a dropdown box, I开发者_如何学JAVA can use the "onBlur" method to do what is needed at that point

What is the method available for an AutoSuggest Textbox that I can employ once a) The desired entry is selected from the list (such as "onSelect"). b) The user never selects, but actually types the entire selection manually. In that case, I would need a method such as "onBeingDoneTyping"

2) When a regular dropdown is defined, I can display a user friendly description (like first and last name). In the meantime, internally I can retrieve what the index of that record is with the first entry of the parameter "value", in my case: PatientID. " " " <%=lsSelected%> ><%=PatientName%>

How can that be accomplished when using the AutoSuggest feature in a textBox?

Say I allow "First-Name Last-Name"

Is there a hidden parameter that can be used that would let me know the index of the selected entry? In addition, should I create a column in the data base "FirstLastName" to speed up the search?


For (1) you're after an auto-complete function. I've used this jQuery with classic-ASP a few times (excellent little plugin): http://docs.jquery.com/Plugins/Autocomplete - there's a good demo and example source there.

For (2) - assuming that you're using the jQuery plugin, then your object is a textbox, not a select object. So if the textbox you created is:

<input type="text" name="example" id="example" />

when the form is submitted any request.form("example") will return the text entered, not the index/selected value from any list of options.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜