Entry
How can I have two submit buttons in the same HTML form?
Aug 15th, 1999 07:56
Nathan Wallace,
What you need to do is to set different names for each submit image
button like this:
<input type="submit" name="type_1" value="Button 1">
<input type="submit" name="type_2" value="Button 2">
Then to check if the form was submitted try:
if(IsSet($type_1))
{
echo "form was submitted by button 1.";
}
else
{
if(IsSet($type_2))
{
echo "form was submitted by button 2.";
}
else
{
echo "form was not submitted by any of the known buttons";
}
}