Hello everyone, happy Monday...yuk (I hate Mondays). Thank-you in advance for any help/suggestions for this posting. I love this site, it rocks. I'm currently making a "teams" page for my baseball league web site and have come across a little snag. Instead of making an individual page for each team in the league I want to make it a dynamic page which will load the MySQL data into the page based on a form to select a team. I want this page to display all the information I currently have for each team in a nice little bundle. On this page I also want to have a a form to select a schedule (which itself will have multiple values). So my question is: How should I go about dealing with the multiple forms when posting back to the same page. Not looking for the code as much as to the process involved.
Thank-you...CHEERS
Multiple "Submit" areas on one page
Moderator: General Moderators
Re: Multiple "Submit" areas on one page
i dont understand why you need multiple forms but if thats what you want
Code: Select all
<?
if (isset($_POST['submit_1_btn']))
{
//process form 1
}
else if if (isset($_POST['submit_2_btn']))
{
//process form 2
}
?>
<form name="form1" action="thispage.php" method="post">
<input type="submit" name="submit_1_btn" />
</form>
<form name="form2" action="thispage.php" method="post">
<input type="submit" name="submit_2_btn" />
</form>
-
Todlerone
- Forum Commoner
- Posts: 96
- Joined: Sun Oct 28, 2007 10:20 pm
- Location: Hamilton, Ontario, Canada
Re: Multiple "Submit" areas on one page
Found something that may be possible. Wow, I'm talking to myself? Would I use with the use of hidden fields? Not sure how to use them, but looks like a possible solution.
Code: Select all
$HTTP_POST_VARS-
Todlerone
- Forum Commoner
- Posts: 96
- Joined: Sun Oct 28, 2007 10:20 pm
- Location: Hamilton, Ontario, Canada
Re: Multiple "Submit" areas on one page
The first one is to select a team from a list. This populates the page from the MySQL database. The other area is to allow the user (with the current selected team from the first "form") to select different types of schedules.
-
Todlerone
- Forum Commoner
- Posts: 96
- Joined: Sun Oct 28, 2007 10:20 pm
- Location: Hamilton, Ontario, Canada
Re: Multiple "Submit" areas on one page
To summerize. I'm sure I don't need the second submit button (the schedule submit). The main idea for this one is to allow the user to display the selected teams schedule or allow for 2 other schedule options (complete-all teams, parks or all available open diamonds) I'm thinking this one should be populated with javascript. However, I don't know js at all (heck...even php for the matter). Was just hoping there was a way (with php) to allow the first form to select a team from a dropdown list, then allow the user to alter the schedule <div> area for multiple selections. Make sense?
Re: Multiple "Submit" areas on one page
you can do that but there is really no need to have that team selection box in a separate form. You can put any numbers of widgets in each form. it will just be another variable that is past on the form
-
Todlerone
- Forum Commoner
- Posts: 96
- Joined: Sun Oct 28, 2007 10:20 pm
- Location: Hamilton, Ontario, Canada
Re: Multiple "Submit" areas on one page
Sorry yacahuma, noob here. What are you triing to say? Widget???yacahuma wrote:you can do that but there is really no need to have that team selection box in a separate form. You can put any numbers of widgets in each form. it will just be another variable that is past on the form
Re: Multiple "Submit" areas on one page
what I mean is each html element, like select, textfield, texarea, etc