jbresette Posted June 23, 2007 Share Posted June 23, 2007 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 More sharing options...
jbresette Posted June 23, 2007 Author Share Posted June 23, 2007 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.""; } ?> Link to comment https://forums.phpfreaks.com/topic/56884-solved-drop-down-menu-form/#findComment-281060 Share on other sites More sharing options...
jbresette Posted June 23, 2007 Author Share Posted June 23, 2007 <? $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. Link to comment https://forums.phpfreaks.com/topic/56884-solved-drop-down-menu-form/#findComment-281071 Share on other sites More sharing options...
jbresette Posted June 23, 2007 Author Share Posted June 23, 2007 Is there any way to call a PHP function in a form drop down list like : onchange = "the PHP function()"? Link to comment https://forums.phpfreaks.com/topic/56884-solved-drop-down-menu-form/#findComment-281120 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.