How I can get the hyperlinks to pass their names as POST variables?
<p>I'm trying to create a form with hyperlinks. When clicked, they submit the page and pass different values.</p>

<p>Here's my code:</p>

<pre><code>&lt;script language="Javascript"&gt;

function submitForm(action){

document.forms["MyForm"].innerHTML = 
    document.forms["MyForm"].innerHTML 
    + "&lt;input type=hidden name=submit value='" + action +"'&gt;";

document.forms["MyForm"].submit();

}

&lt;/script&gt;


&lt;form name="MyForm" action="test.php" method="post"&gt;
&lt;input type="text" name="abc" value="" /&gt;
&lt;a name="edit" href="javascript:void(1);" onClick="submitForm('Edit');"&gt;Edit&lt;/a&gt;

&lt;a name="delete" href="javascript:void(1);" onClick="submitForm('Delete');"&gt;Delete&lt;/a&gt;&lt;/form&gt;
</code></pre>

<hr>

<p>When I click on href link, I get the error </p>

<pre><code>document.MyForm.submit is not a function
[Break On This Error] document.MyForm.submit(); 
</code></pre>

<p>Anyone know why this error occurs?</p>
