<html>
<head>
    <script>
    function log(msg) {
        var res = document.getElementById('res');
        res.innerHTML = res.innerHTML + msg + "<br>";
    }
    
    function test() {
        var tf = document.getElementById('tf');

        if (window.testRunner) {
            testRunner.dumpAsText();
        }
        
        tf.focus();
        if (window.testRunner) {
            eventSender.keyDown('a');
            eventSender.keyDown('\r');
        }

    } 
    </script>
</head>
<body onload="test()">
    This tests that onchange fires when you press Enter to submit a form.<br>
    <form name="fm" onsubmit="log('on submit'); return false;">
        <input type="text" id="tf" onchange="log('text onchange')" onblur="log('text onblur')"></input>
    </form>
    <div id="res"></div>
</body>
</html>
