Bug Tracker

Opened 11 years ago

Closed 11 years ago

#2904 closed bug (invalid)

Change form element value doesn't fire event

Reported by: grzegorz Owned by:
Priority: major Milestone: 1.2.4
Component: event Version: 1.2.3
Keywords: event value Cc:
Blocked by: Blocking:

Description

If you try to change form element (e.g. input) value using val() function, input.change() event is not executed.
Bind doesn't work either.

Simple example:

<form>
	<input type="text" id="text" />
	<button id="button">change value</button>
</form>
<script type="text/javascript">
$(document).ready(function() {
	$("#button").click(function() {
		$("#text").val('New value');
		return false;
	});
	$("text").change(function() { alert('Event!'); });
});
</script>

Change History (1)

comment:1 Changed 11 years ago by scott.gonzal

Resolution: invalid
Status: newclosed

Programmatic changes to input values do not trigger the change event; this is not related to jQuery.

Note: See TracTickets for help on using tickets.