Skip to main content

Bug Tracker

Side navigation

#10132 closed bug (fixed)

Opened August 25, 2011 03:06AM UTC

Closed September 21, 2011 03:13AM UTC

Last modified September 21, 2011 03:18AM UTC

.val(...) in change handler invokes change handler in IE

Reported by: Owned by: dmethvin
Priority: low Milestone: None
Component: event Version: 1.6.2
Keywords: Cc:
Blocked by: Blocking:

When you have a function bound the the change event of an input field, and the function changes the input field's value using .val(...), the change event handler gets invoked twice (once from the real change, and once from calling .val(...)). This happens in IE8 and IE9, but not in FireFox 6 or Chrome.

The expected output from the code below is that "change" will be logged once, however it actually gets logged twice in IE.

<!doctype html>
		<input type="text" id="inputField" />
		<script src=""></script>
			$("#inputField").change(function() {

Attachments (0)
Change History (4)

Changed August 25, 2011 01:32PM UTC by timmywil comment:1

component: unfiledevent
priority: undecidedlow

Confirmed, but I'm not sure we can fix this. Changing the value with javascript triggers a change in IE, but not in other browsers.

Changed August 27, 2011 08:14PM UTC by dmethvin comment:2

owner: → dmethvin
status: newassigned

Since it's using the special event interface there may be a solution; I'll mark it open and look at it soon.

Changed September 21, 2011 03:13AM UTC by dmethvin comment:3

resolution: → fixed
status: assignedclosed

This is fixed by the new IE change detection logic in 1.7.

Changed September 21, 2011 03:18AM UTC by dmethvin comment:4

#8040 is a duplicate of this ticket.