why have you named the submit button "add"? sounds more like an
action.
how bout naming it a nice generic "submit"
<form name="myForm" method="post">
<INPUT type="hidden" name="action" value="edit">default action = edit
<input type="submit" name="submit">
<a href="#" onClick="document.myForm.action.value='edit';
document.myForm.submit();">edit</a>
<a href="#" onClick="document.myForm.action.value='modify';
document.myForm.submit();">modify</a>
me**********@yahoo.com (Marc) wrote in message news:<ac**************************@posting.google. com>...
Hello,
I have a self - submitting form with multiple submits and I want to
detect after the submit which button is pressed.
Code example:
<form name="example" method="post" action="/test.php">
<input type =submit name="add"> form elements but also
<a href="#" onClick=document.myForm.submit()>edit</a>
<a href="#" onClick=document.myForm.submit()>modify</a>
</form>
If I submit the form by clicking either of these elements, how do I
detect in PHP which element was used to submit the form?
TIA,
Marc