Two Submit Buttons, Want to Run Separate Parts of a Script Based on Which is Clicked
<p>Ok so I have two submit buttons, a standard submit button, as well as a , etc, etc button.</p>

<p>Anyway, the second button is a delete button, but both of them go to the same function, because of onSubmit.</p>

<p>What I want to do is set up an if statement to see if the delete button was pressed.</p>

<p>Here's the code to generate the delete button (the value is generated by PHP):</p>

<pre><code>&lt;button type="submit" name="del" id="deletebutton" value="'.$org.'"&gt;Delete&lt;/button&gt;
</code></pre>

<p>Here's my idea so far:</p>

<pre><code>    if (document.getElementById('deletebutton').value != '') {
     BLAHBLAHBLAH CODE HERE for delete button click;
    }
else {
BLAHBLAHBLAH Code for non-delete button click;
}
</code></pre>

<p>but my IDE (NetBeans) seems to show an error when I try to do this. How would the correct way to do this be?</p>

<p>EDIT: DOH typo!</p>
