<body onload="runTest()">
<script>
function runTest() {
if (window.testRunner) {
    testRunner.dumpAsText();
}
var form = document.createElement('form');
var input = document.createElement('input');
input.setAttribute("name", "test_field");
form.appendChild(input);

var message = "Failed";
try{
   if (form.test_field)
       message = "Passed";
}catch(e){
}
var console = document.getElementById("console");
var text = document.createTextNode(message);
console.appendChild(text);
}
</script>
<p>This tests looking up form elements from a form that is not yet appended to a document. See bug 10188.</p>
<div id="console"/>
</body>
