Plugin options page – form with two different submit buttons

In my plugin options page I have two buttons, netted way down looks like this – a single form, with two submit buttons.

<form action="options.php" method="post">
<input id="submit_button" name="submit" type="submit" class="button-primary"   value="Save Stuff" />
<input id="remove_button" name="remove" type="submit" class="button-secondary" value="Remove Stuff" />
</form>

PHP:

if( isset($_POST['remove']) ) ...do something....;
if( isset($_POST['submit']) ) ...do something else...;

The above logic never executes – the parameters do not seem to be POSTing when the form is submitted, regardless of button pressed. Any insight would be greatly appreciated.

0

Leave a Comment