0

I create comment box like a facebook comment box. I have to do like this in textarea box type @ sign and after I type letter then detect this letter or letters and popup friend list.

$("textarea#event_message").autocomplete("friendsAutoComplete"); 

this method used for autocomplete that works fine. but want this method fire after type @ sign.

I tried this way

$('textarea#event_message').keypress(function(event) { if(event.which == 64) { $('textarea#event_message').autocomplete("friendsAutoComplete"); } }); 

and I also tried jquery live method

It doesn't like work.How can I solve that problem?

1 Answer 1

1

First of all, what is the string "friendsAutoComplete" you referring?

To fire a search using an initialized autocomplete widget, you should call the search method instead.

http://jqueryui.com/demos/autocomplete/

So you may try out

$('textarea#event_message').keypress(function(event) { if(event.which == 64) { $('textarea#event_message').autocomplete("search"); } }); 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.