Page 1 of 1

Form Submission multiple forms on page...

Posted: Thu Jan 29, 2009 3:03 pm
by rhyno
Hello I am writing a cms system for a kennel and am relatively new to php...
I have an edit.php page, which has multiple forms on it.

Code: Select all

<form action="'.$page.'" method="get" name="xxx1">
and

Code: Select all

<form action="'.$page.'" method="get" name="edit1">
$page is calling the edit.php page again.

My question is how can I check to see if the form edit1 was submitted. I know it must be simple but I can not guess what the answer is....

Can you please refresh my memory a bit.
Thank
-Rhyno

Re: Form Submission multiple forms on page...

Posted: Thu Jan 29, 2009 4:14 pm
by requinix
You can add a hidden input field to each form, like

Code: Select all

<form action="'.$page.'" method="get" name="xxx1">
<input type="hidden" name="form" value="xxx1">
 
<form action="'.$page.'" method="get" name="edit1">
<input type="hidden" name="form" value="edit1">

Re: Form Submission multiple forms on page...

Posted: Thu Jan 29, 2009 4:20 pm
by sergio-pro
You should already have inputs for that:

Code: Select all

 
 
<form action="'.$page.'" method="get" name="xxx1">
<input type="submit" name="form1" value="Save Form A">
 
<form action="'.$page.'" method="get" name="edit1">
<input type="submit" name="form2" value="Save Form B">