Bug Tracker

Changes between Initial Version and Version 1 of Ticket #8040


Ignore:
Timestamp:
Jan 28, 2011, 8:33:24 AM (8 years ago)
Author:
jitter
Comment:

This bug looks valid after a first quick check.

test case trying to simulate all of this without jQuery.

test case using jQuery.bind showing the double call behavior.

Maybe something is bogus in the special handling of the change event to make it bubble in IE.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #8040

    • Property Priority changed from undecided to low
    • Property Status changed from new to open
    • Property Component changed from unfiled to event
  • Ticket #8040 – Description

    initial v1  
    22
    33Test code:
    4 <input name="str1" id="str1" value="str1">
    5 <script>
    6 function toUpper() {
    7         document.getElementById("str1").value = document.getElementById("str1").value.toUpperCase();
    8 }
    9 function changeTest() {
    10         alert(1);
    11 }
    12 jQuery("#str1").bind("change", toUpper);
    13 jQuery("#str1").bind("change", changeTest);
    14 </script>
     4{{{
     5<input name="str1" id="str1" value="str1">
     6<script>
     7function toUpper() {
     8    document.getElementById("str1").value =
     9        document.getElementById("str1").value.toUpperCase();
     10}
     11function changeTest() {
     12    alert(1);
     13}
     14jQuery("#str1").bind("change", toUpper);
     15jQuery("#str1").bind("change", changeTest);
     16</script>
     17}}}
     18Test result:
    1519
    16 Test result:
    17 In IE(both IE6 and IE8), when input "abc" into str1, "1" will be alerted twice.
    18 In Firefox, it is OK, only alert once.
     20- In IE(both IE6 and IE8), when input "abc" into str1, "1" will be alerted twice.
     21
     22- In Firefox, it is OK, only alert once.