Hello,

I'm trying to find out which form button a user clicked.

Because all of my from buttons are images I'm using:

<form action ="?">
<input type ="image" src="button1.gif" name = "Next" >
<input type ="image" src="button2.gif" name = "Prev" >
</form>

Then when my php script receives this form, how do I test for which button was pressed please?

I've tried:

if ($Next):
echo "next was pressed<br>";
endif;

if ($Prev):
echo "Prev was pressed<br>";
endif;

and also.....


if ($Next.x):
echo "next was pressed<br>";
endif;

if ($Prev.x):
echo "Prev was pressed<br>";
endif;

but none of these identify the button uniquely.

Does anyone know if it's possible to determine which button was pressed using input type ="image" please?

Thank you,

Jason