Bug Tracker

Ticket #2904 (closed bug: invalid)

Opened 6 months ago

Last modified 6 months ago

Change form element value doesn't fire event

Reported by: grzegorz Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.2.4 Component: event
Version: 1.2.3 Keywords: event value
Cc: Needs: Review

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

Change History

Changed 6 months ago by scott.gonzalez

  • status changed from new to closed
  • resolution set to invalid

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.