learntosucceed
learntosucceed

Reputation: 1139

Which jquery event is for autocomplete?

I'm trying to trigger something after I make the autocomplete to fill in the #inputField. This autocomplete is from your form history thing.

I've tried on firefox, and IE. It works in IE, but not firefox.

$('#inputField').bind("change keyup", function(){
//do something
});

and

$('#inputField').on("change keyup", function(){
//do something
});

Upvotes: 0

Views: 52

Answers (1)

myfunkyside
myfunkyside

Reputation: 3950

I don't know if you can detect auto-complete, but if you're just trying to detect input (like you're doing in the code in your question), try this:

$('#inputField').on('input change propertychange',function(){
    //do something
});
  • change and propertychange aren't really necessary or helpful here, because those fire on things like dropdowns and radio-buttons, but you can just leave them in so you always have the complete check.

From here you could manually check whether it's likely that some of the input is auto-completed, using some intricate coding, like checking if a part of the text is selected...

Upvotes: 1

Related Questions