webshim icon indicating copy to clipboard operation
webshim copied to clipboard

Change event is only triggered on blur

Open devlife opened this issue 14 years ago • 3 comments

I have a change handler wired up to a number input. However, the handler is only triggered when focus leaves the input. Any ideas?

devlife avatar Sep 12 '12 17:09 devlife

Yes, please use the input event, instead:

$('input[type="number"]').bind('input', function(e){
    console.log($.prop(this, 'value'));
});

aFarkas avatar Sep 12 '12 20:09 aFarkas

That did the trick. Thanks.

devlife avatar Sep 13 '12 17:09 devlife

Change event is not triggered if keypress/keydown/mousewheel is used. Need to implement ui with commit action.

aFarkas avatar Sep 14 '12 00:09 aFarkas