Jump to content

[SOLVED] Drop Down Menu Form


jbresette

Recommended Posts

Here is my form

 

http://www.jbresette.com/wrestling/dualform.php

 

My question is this.  At the top for Home Team and Away Team I am pulling the team names out of my database using PHP.  Then when you get to the wrestlers each wrestler has a school.  Therefore, I want their choices to only be between the two selected at the two teams selected at the top of the form.  How would I go about putting those values in the form pulling it from the values at the top?

Link to comment
https://forums.phpfreaks.com/topic/56884-solved-drop-down-menu-form/
Share on other sites

I have something like this but keep getting the error

 

 

Parse error: parse error, unexpected T_STRING, expecting ')' in /home/content/j/b/r/jbresette/html/wrestling/dualform.php on line 85

 

 

<?
$selectedHomeTeam = "Home Team";
$selectedAwayTeam = "Away Team";

function changedHome(HomeTeam)
{
$selectedHomeTeam = "".HomeTeam.options[HomeTeam.selectedIndex].value."";
}

function changedAway(AwayTeam)
{
$selectedAwayTeam = "".AwayTeam.options[AwayTeam.selectedIndex].value."";
}
?>

<?
$selectedHomeTeam = "Home Team";
$selectedAwayTeam = "Away Team";

function changedHome()
{
$selectedHomeTeam = $_GET('HomeTeam');
}

function changedAway()
{
$selectedAwayTeam = $_GET('AwayTeam');
}
?>

 

 

Ok I got past that error, now I have to figure out when to call the function in the form. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.