I have a form where I use 2 submit buttons :
- Code: Select all
<input type="submit" name="action" value="Update" />
<input type="submit" name="action" value="Delete" />
- Code: Select all
Then in the code check to see which was triggered:
if ($_POST['action'] == 'Update') {
//action for update here
} else if ($_POST['action'] == 'Delete') {
//action for delete
} else {
//invalid action!
}
How must I change this using button/menu maker ?
I have defined a button like this and use onclick. With 1 button I can use a hidden field, but when I want 2 buttons ? :
- Code: Select all
<div id="mbsubmitebul_wrapper">
<ul id="mbsubmitebul_table" class="mbsubmitebul_menulist css_menu">
<li><a href="" onclick="document.getElementById('form1').submit();return false;">
<div class="buttonimg buttonimg_31" style="width: 76px; background-image: url('mb_speichern.png')">Speichern</div></a></li>
</ul>
</div>
But it works only with on Button. I must pass some kind the value, so I can recognize the button what was pushed.