开发者

jQuery use change event on input text

开发者 https://www.devze.com 2022-12-12 21:41 出处:网络
Some drop down lists on my project have so many options that I\'m changing those to input texts with an autocomplete function (using jquery autocomplete plugin).

Some drop down lists on my project have so many options that I'm changing those to input texts with an autocomplete function (using jquery autocomplete plugin).

But, in drop down lists I can use a change event and use its value to fire an ajax function, for example. But, with an autocomplete, I don't know how to do that and I want to keep the change event. When I use the change event, nothing happens, or just works and there's some value on the input text and you erase its text and blurs.

Summaring: I want to use an change event on a aut开发者_Go百科ocomplete input text.

Thanks!!


If I understood your problem correctly, you could use the keyup event to fire a function everytime a key is pressed and released in the input field.


There are various options, including functions that are called at various stages of the autocomplete workflow, which you can specify. I would suggest sticking your logic in the FormatItem function.

Details are in the jQuery API.

0

精彩评论

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