correct way to use variables in the javascript DOM
<p>What is the correct way to format the document.formToSubmit.submit() line?</p>

<pre><code>    var formToSubmit = 'postcomment' + id;

    alert( ''+ formToSubmit +'' );

    document.formToSubmit.submit();
</code></pre>

<p>The formToSubmit variable seems to be correct but the submit() does not work.</p>
