Adrian said:
I need to have 2 submit buttons in one form calling the same page. I
just
need to know which was used.
<input type="submit" name="s" value="1">
<input type="submit" name="s" value="1">
<?php
print $_REQUEST['s'];
?>
No need for JavaScript.
I assume that the values for the two buttons were supposed to be different?
To the OP: If the submit button[1] has a name and value, that pair will be
sent with the rest of the data on submission. If there is more than one
button, only the clicked button will have its name/value pair sent. This
will allow you to check which button was pressed server-side.
If you need to check before the form is sent, I think the only way is to
place onclick intrinsic events on the button elements. However, cancelling
the click event might not (I can't remember) stop the form submission, if
that was your intention.
Mike
[1] Either <input ... type="submit"> or <button ...
type="submit">...</button>