开发者

Alternative to HTML Dropdown

I'm currently having a really long list of university names that are not sorted in alphabetical order. What the user needs to do is quickly find the university's name he/she wants, however the user may or may not know the specific university name, it is requested that the user type one or two keywords and the required university name should appear. Obviously, dropdown wouldn't work out well, what can I do?

EDIT: The user may not know how the university is named, for example the user wants Tokyo University, but in the list, is is "The University of Tokyo", so how do I do so that if the user types in Tokyo University, it will still display "The University of Tokyo" as well (of course, there will 开发者_开发知识库be some other university names listed as well...).


Autocomplete? Similar to google's suggestion stuff? Simple with a bit of Ajax and jQuery.


If you're okay with using jQuery, the autocomplete plugin does exactly what you want. You can configure it to use a URL to fetch names as the user types. If the university names are stored in a database, you can write a script to look up all matching names and return them.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜