Skip to main content

Bug Tracker

Side navigation

#2904 closed bug (invalid)

Opened May 20, 2008 09:05AM UTC

Closed May 20, 2008 02:48PM UTC

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>
Attachments (0)
Change History (1)

Changed May 20, 2008 02:48PM UTC by scott.gonzal comment:1

resolution: → invalid
status: newclosed

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