M2 wrote:
Hi,
a have a single form whose elements reside in a table. I want to present a
"Submit" and "Cancel" button at the bottom each of which have a different
destination. This is of course easy to do if you either a) use javascript on
a button or b) go to the dark side and put a form within a table. I would
like to avoid these two techniques if possible. Any ideas?
Here's a possible solution:
have two different "submit" buttons, with different names. On the CGI
side, check for the existence of the variable <name> (you do this
differently if you use GET or POST). Here's an example using PHP:
<form name="myform" method="POST" action"http://url/post.php">
<input type="text" name="information">
<input type="submit" name="submit_ok" value="Submit">
<input type="submit" name="submit_cancel" value="Cancel">
</form>
And here is post.php:
<?
if (isset($_POST["submit_ok"]))
{
// process SUBMIT
}
else if (isset($_POST["submit_cancel"]))
{
// process cancel
}
?>
I haven't tested this though but it should work.
--
luc wastiaux - email:
du*******@airpost.net