Bug Tracker

Opened 15 years ago

Closed 15 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:


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:

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

Change History (1)

comment:1 Changed 15 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.