.submit() and form validation in JavaScript
<p>I am trying to sharpen my vanilla JavaScript skills a little bit.  I am working on a form validator just for fun.  Here is my code thus far:</p>

<pre><code>var getParent = document.getElementById("myForm");

document.getElementById("submit").onclick = function(e) {

e.preventDefault();

var cache = !cache ? "Nothing has been selected" : cache;

for(i = 0; i &lt; getParent.elements.method.length; i++) {

    if(getParent.elements.method[i].checked) {
        cache = getParent.elements.method[i].value;
    }

}

getParent.submit();

}
</code></pre>

<p>As you can see, this just tests some radio buttons to see if they are checked or not.  I am trying to use the <code>.submit()</code> function at the bottom to submit my form, but I am getting an error.  Why is this code not submitting my form with <code>.submit()</code>??</p>
