Change Event, Bubbling and IE8

This is a compliance issue with Internet Explorer.

If a change event can bubble, what can it bubble up to?

Will it be possible to observe a bubbled change on a FORM?

http://www.w3.org/TR/DOM-Level-2-Events/events.html


| change
|    The change event occurs when a control loses the input
| focus and its value has been modified since gaining focus.
| This event is valid for INPUT, SELECT, and TEXTAREA. element.
|
|        * Bubbles: Yes
|        * Cancelable: No
|        * Context Info: None



Internet Explorer 8 still does not support EventTarget, however, it
does support bubbling.

The result below from Safari3 and Firefox3 are that the change and
submit events bubble and alerts are shown.

IE8: No alert shown.


=============================================================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> Change </title>
</head>

<body>

<h1>Form Dirty?</h1>

<form id='big'>

  <fieldset id="ff"><legend>legend</legend>
  <select name='big'>
    <option>one</option>
    <option>two</option>
  </select>

  <textarea name="a">foo</textarea>
  <label>
    <input type="radio" name="df"/>radio
  </label>
    <input type="radio" name="df"/>radio
  <input type="checkbox"/>
  <input type='text'/>
  <input type="password"/>
  <input type="submit" value="go"/>
</fieldset>

</form>

<script>
  var big = document.getElementById('big');

  if(big.addEventListener) {
    big.addEventListener("change", getTimeStamp, true);
    big.attachEvent("submit", getTimeStamp, true);
  } else if(big.attachEvent) {
    big.attachEvent("onchange",  getTimeStamp, true);
    window.attachEvent("submit", getTimeStamp, true);
  }
  function getTimeStamp(e){
      alert(e.timeStamp);
  }
</script>

</body>
</html>
=============================================================================

If MSIE is not going to implement DOM Events, what should be the
expected behavior of MSIE?

Garrett

Received on Friday, 11 July 2008 03:30:15 UTC