E
E
EVOSandru62015-10-13 07:19:01
JavaScript
EVOSandru6, 2015-10-13 07:19:01

What event in jquery is fired when a cached dropdown is selected in input type text?

Tried:

$('body').on('keyup keydown keypress change','input[type=text]', function()
{
      ...
});


The action is only hooked if I select a value from the drop down list and left click outside the bounds of the given input

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Ineshin, 2015-10-13
@EVOSandru6

Let's get a look. Change - called when yours has input[type=text]lost focus and at the same time its value has changed. Not the best choice. You'd be better off with the modern input event . It fires every time, even if the focus hasn't changed. In addition, it also responds to pasting text from the buffer. Take a look at the demo here: jsfiddle.net/IonDen/v606ka0r
So the strategy is:
- Modern browsers and IE9+: input
- Need support for older browsers:input keyup change

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question