The form header should specify which page you want to go to when you submit
the form.
If you require to go to diffent pages depending on which button is pressed
you can set a hidden variable to specify the required page/action. Then
include the correct action code using a switch statement.
<form name="form_name" method="post" action="action_page.php" onsubmit=....>
<input type="hidden" name="action" value="">
<input type="submit" name="Submit" value="Submit Request"
OnClick="action.value='submit';" class="button">
<input type="submit" name="Edit" value="Edit Request"
OnClick="action.value='edit'" class="button">
</form>
//action_page.php
switch($action)
{
case "submit":
include "submit.php";
break;
case "edit":
include "edit.php";
break;
default:
include "default_page.php";
break;
}
-Stewart
-----Original Message-----
From: Jennifer Arcino Demeterio [mailto:[EMAIL PROTECTED]]
Sent: 10 July 2001 11:43
To: 'php-db'
Subject: [PHP-DB] problem with form
hello,
hope anyone has an idea on how to fix this...
<form>
<input type="submit" name="Submit" value="Submit Request"
OnClick="submit.php" class="button">
<input type="submit" name="Edit" value="Edit Request" OnClick="edit.php"
class="button">
</form>
even i click on the edit button, it will still go to submit.php page, why is
that?
thanks
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]