开发者

JavaScript dialog box / context menu for text areas

开发者 https://www.devze.com 2022-12-22 01:25 出处:网络
I am working on a project at the moment that requires a dialog box or context menu to display when the text in the box matches a certain regex pattern.

I am working on a project at the moment that requires a dialog box or context menu to display when the text in the box matches a certain regex pattern.

For example, if I was to type @user into the text area, a dialog box would show up where the cursor is or just below the typed word containing Ajax generated list of possible matched user names.

Are there any J开发者_C百科avaScript packages (preferably a jQuery add-on) that will do this kind of functionality?


I think what you are looking for is a jQuery autocomplete plugin. Here is a site that lists 10 of them: http://webtecker.com/2008/03/10/10-auto-complete-ajax-scripts/

(Disclaimer: I have no relationship with this site.)


You can try this: http://docs.jquery.com/Plugins/Autocomplete

You might have to tweak it to match your requirements, but some of the basic functionality is there.

0

精彩评论

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