Using button images for multiple submit buttons.
Posted: Sun Jul 14, 2002 9:52 am
I can use images just fine if the form has only one submit input, but how can I do it when it has two?
My plan is the user clicks on an item in the list and then clicks a button to either revise it or delete it.
The above works fine -- $_POST['Submit'] contains either "Delete" or "Revise" depending on which button the user clicked.
For that code the $_POST['Submit'] does not contain "Delete."
My plan is the user clicks on an item in the list and then clicks a button to either revise it or delete it.
Code: Select all
print("<table>\n<form method=post action=clntdata.php>\n");
print("<tr><td width=240 colspan=3>");
$Query = "SELECT id,Name FROM Inst ORDER BY Name";
$Result = mysql_query($Query, $Link);
print("<SELECT NAME=Inum SIZE=8>\n");
while ($row = mysql_fetch_array($Result))
print("<OPTION VALUE=$rowїid]>$rowїName]</OPTION>\n");
print("</SELECT>\n");
print("</td></tr>\n<tr><td width=70 align=left>\n");
print("<INPUT TYPE=SUBMIT Name=Submit VALUE=Delete>");
print("</td>\n<td width=100 align=left>\n");
print("<INPUT TYPE=SUBMIT Name=Submit VALUE=Revise>");
print("</td><td width=70> </td></tr>");
print("</form>\n</table>");Code: Select all
print("<INPUT TYPE=SUBMIT Name=Submit VALUE=Delete SRC=button1.gif>");