views:

61

answers:

2

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 JavaScript packages (preferably a jQuery add-on) that will do this kind of functionality?

A: 

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.

Dan
Is there a way to do this not using jQuery?
It's not too difficult to implement. Listen to the `keyup` event on the textbox, match the content of the textbox against a list of regexes and attach behaviors when you find a match. Basically :)
Dan
A: 

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.)

e4c5