Bug Tracker

Opened 10 years ago

Closed 10 years ago

#6051 closed bug (duplicate)

'.bind' binds change event only after first change

Reported by: ben.mcintyre Owned by:
Priority: Milestone: 1.4.2
Component: event Version: 1.4.1
Keywords: Cc:
Blocked by: Blocking:

Description

Code below is more or less from your sample. I'm trying to bind all the input controls to a change event. This works in 1.3, but in 1.4 the controls can be changed once without triggering a change event, then re-entering the control and changing text a second time triggers the change event. Weird.

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 TransitionalEN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head>

<style> textarea { height:25px; } </style> <script src="js/jquery.min.js"></script>

</head> <body>

<form>

<input type="button" value="Input Button"/> <input type="checkbox" />

<input type="file" /> <input type="hidden" /> <input type="image" />

<input type="password" /> <input type="radio" /> <input type="reset" />

<input type="submit" /> <input id="tb" type="text" /> <select><option>Option</option></select>

<textarea></textarea> <button>Button</button> <a href="javascript:printb()">test</a>

</form> <div id="messages"> </div>

<script type="text/javascript">

$(document).ready(function() {

$(":input").bind("change", function() { alert('hi 123'); });

});

</script> </body> </html>

Change History (1)

comment:1 Changed 10 years ago by john

Component: traversingevent
Resolution: duplicate
Status: newclosed

Duplicate of #5851.

Note: See TracTickets for help on using tickets.