Jump to content

More than one input button on a form?


sepoto

Recommended Posts

I am trying to come up with a system where I can have multiple input buttons on a form and detect which input button was pressed once the form is processed.

<form action="displaydata.php" method="post"><input type = 'Submit' Name = 'submit01' Value = 'get recordset'><input type = 'Submit' Name = 'submit02' Value = 'auto weed recordset'></form>

displaydata.php:

<?php	/* Is it possible to detect in here which input button was pressed? */?>

Thank you.

Link to comment
Share on other sites

You can check for particular button set or not to determine which button has been pressed.

if(isset($_POST['submit01']))//submit01 pressed

You can also check for button value also

Link to comment
Share on other sites

You can check for particular button set or not to determine which button has been pressed.
if(isset($_POST['submit01']))//submit01 pressed

You can also check for button value also

I see the use of isset() again is my solution. What a handy function. Thank you.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...