Hello,
I'd like to be able to have two submit buttons which call the same script and process the same form. What I am not understanding is how I can determine which button was clicked in the subsequent script. A simple code snippet of form is below:
<form name="form" method="post" action="doScript.php">
<input type="text" name="field1">
<input type="text" name="field2">
<input type="text" name="field3">
<input type="submit" name="addMore" value="Add More">
<input type="submit" name="saveTask" value="Finished">
</form>
I want to be able to determine which submit button was clicked ("addMore" or "saveTask") in the subsequent doScript.php script.
Note: when I proccess the forms input as follows (doScript.php snippet), there are no references to the submit buttons
$keys = array_keys($POST);
for ( $i = 0; $i < sizeof($keys) - 1; $i++ ) {
$$keys[$i] = $POST[$keys[$i]];
}
Any ideas?
Thanks
Andesa