If a change event is fired, when will the value of the text field be changed both manually and programmatically?

I have a jQuery UI autocomplete text box with a remote data source. An autocomplete event selecthas three functions:

  • Updates the value of the text field to the one selected from the autocomplete list.
  • Makes an AJAX call to load some more data onto a page
  • Move focus to another text field (created in the previous step)

There is also an event in the text box changethat deletes the data downloaded in step 2 above and fires an autocomplete event search.

This works fine in IE (tested with versions 9 and 10), but not in Firefox. When I make a selection from the autocomplete list, additional data is never displayed (although analysis of network traffic shows that an AJAX call is in progress) and an autocomplete event fires search. I managed to track the issue to Firefox by triggering a text field event changeafter step 3 above, apparently because I typed something into a text field to call up an autocomplete list, and although the text field was later updated programmatically .

Quick example: http://jsfiddle.net/2umrJ/1
(For brevity, this example just uses an event keyupin a text field.)

Output in IE10:

input1.focus () started
input1.blur () started
input2.focus () started

Firefox 20:

input1.focus()
input1.change()
input1.blur()
input2.focus()

, Firefox change, IE - . , (.. - ) change , , , ,

, , Firefox (, , ), ? , change , , , - .

+5
1

- firefox, - , , , , , , reset .

+3

All Articles