Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change event not firing on text input using jquery in Chrome

I have a problem with a jquery change event on a text input that works as expected in Firefox and IE but not in Chrome. I also have a keyup event on the text input to manipulate the input as it is entered, but when the input is done I need to run some extra code. I tried using the 'blur' event and the 'focusout' event as someone here had suggested as a substitute, but then I couldn't change focus at all -- the input kept grabbing it back somehow. Here is the code:

 $('.textInput').keyup(function(event) { /* do stuff */ });
 $('.textInput').change(function(event) { alert('Changed!'); /* do other stuff */ });

and the html:

 <input type="text" class="textInput" value="" />

I am using jQuery 1.6.3. Any suggestions would be greatly appreciated. H.

like image 901
user1084458 Avatar asked Dec 06 '11 22:12

user1084458


1 Answers

The change event will not fire unless the input focus switched to other controls

like image 159
James L Avatar answered Oct 27 '22 08:10

James L