Forum Moderators: coopster
Ive worked out how to use multi submit buttons in one form.
I heard it cant be done, but this is myth.
here is what to do:
In a While loop:
while (blah..){
echo "<td><input type=\"submit\" value=\"Update\" name=\"button1_$id\" ></td>";
echo "<td><input type=\"submit\" value=\"Delete\" name=\"button2_$id\" ></td>";
Note: the _$id //(what ever you want to name that)
$id=$row['id']; //(Im using the PK from the db, use what you want, it so, inciment it.
$id++
}
//plus, use the _$id (eg: "<input type=\"text\" size = 10 name=\"choice_$id\"....>";) at the end of what ever fields u want if updating db rows.. this works very well. Im using on multi rows (from textboxes)
:)
I hope this help someone.
But multiple submit buttons, absolutely, only the submit button pressed will be present in $_POST/$_GET.
However, you still have an issue to work out with what happens when someone presses the enter key. :-)