I need to dynamically populate a list of options into chosen drop-down from a server - as user types.
Ajax part of it (jQuery requests sent to ASP.NET MVC controller) is obvious. I also understand that as soon as jQuery receives results I can repopulated underlying HTML select box and then run $("#form_field").trigger("chosen:updated");
But is there an easy and standard way of binding event handler to keypress (or keydown) event as user types?
Again, I can probably find that DIV element generated by chosen and use its events, but maybe there is an easier way chosen itself exposes?
I need to dynamically populate a list of options into chosen drop-down from a server - as user types.
Ajax part of it (jQuery requests sent to ASP.NET MVC controller) is obvious. I also understand that as soon as jQuery receives results I can repopulated underlying HTML select box and then run $("#form_field").trigger("chosen:updated");
But is there an easy and standard way of binding event handler to keypress (or keydown) event as user types? Again, I can probably find that DIV element generated by chosen and use its events, but maybe there is an easier way chosen itself exposes?