RE: [PHP-DB] problem with form

From: Date: Tue, 10 Jul 2001 10:55:44 +0000
Subject: RE: [PHP-DB] problem with form
Groups: php.db 
Request: Send a blank email to php-db+get-10204@lists.php.net to get a copy of this message
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:eper@tridel.net] 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: php-db-unsubscribe@lists.php.net For additional commands, e-mail: php-db-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#10204) next »