Ok so I have two submit buttons, a standard submit button, as well as a , etc, etc button.
Anyway, the second button is a delete button, but both of them go to the same function, because of onSubmit.
What I want to do is set up an if statement to see if the delete button was pressed.
Here’s the code to generate the delete button (the value is generated by PHP):
<button type="submit" name="del" id="deletebutton" value="'.$org.'">Delete</button>
Here’s my idea so far:
if (document.getElementById('deletebutton').value != '') {
BLAHBLAHBLAH CODE HERE for delete button click;
}
else {
BLAHBLAHBLAH Code for non-delete button click;
}
but my IDE (NetBeans) seems to show an error when I try to do this. How would the correct way to do this be?
EDIT: DOH typo!
You forgot the closing parenthasis, that is why you are getting an error: