variable (form.onsubmit) still null after assignment
<pre><code>function registerForm(formName){
    if(!formName)
        return;
    var form = document[formName];

    form.onSubmit = function(){
        console.log('I am the onsubmit function');
    };
    console.log('onsubmit set: ' + form.onsubmit);
}


window.onload = function(){

    registerForm('myform');

};
</code></pre>

<p>This is a snippet of a larger section of code.</p>

<p>As you can see, I am assigning form.onsubmit to equal an anonymous function</p>

<p>However, the assignment does not work.</p>

<p>Replacing the assignment with form.onsubmit = 1 does not work either - the value is still null afterwards.</p>

<p>Any help appreciated. Thanks.</p>
