I have a form, EWMS.php, that is a score sheet for a dart league. In this form I first have a user choose a division. Ajax returns that choice via MySQL database and PHP. Upon choosing a division that also fills in the next drop down choices of team, which again calls Ajax and brings in the teams associated with the division choice. All works good so far. The last call on team choice drop down brings in the players on that team in another drop down which is peppered throughout the form as it is based on these players that are chosen.
The beggining form tag and ending form tag are located in the EWMS.php file while Ajax loads other input elements from the database into the middle of the form.
So now that the form works with these drop downs grabbing MySQL data, I am testing the data the user input by using action="process.php" method="post" in the form tag.
In process.php I have some basic code:
$date=$_POST['date'];
$week=$_POST['week'];
$league=$_POST['league'];
//HOME TEAM
$teamH=$_POST['teamH'];
//VISITING TEAM
$teamV=$_POST['teamV'];
echo "On " . $date . ", week " . $week . ", in the " . strtoupper($league) ." division" . "<br />";
echo "Home Team: ". $teamH . " vs. " . "Visiting Team: ". $teamV ."<br />";
What I get from the proces.php is this:
On 11/16/2011, week 14, in the division
Home Team: vs. Visiting Team:
So while I am getting the date and week (which are located in the main EWMS.php form), but am not getting the division or the home and visiting team names which are located in my ajax calls to findleague.php, findhometeam.php and findvisitingteam.php.
Only what appears in my original form elements: date, week, totalscore hometeam, totalscore visitingteam and the add_a_player fields. All the Ajax calls that bring in the other form elements are not found.
Here is my league code from inside the EWMS.php :
<!--League drop down-->
<div id="league" style="clear:left;">
<table width="100%" border="1" cellspacing="4" cellpadding="0" style="background-color:#ffffff;">
<tr>
<td width="100" align="center"><strong>Home</strong></td>
<td width="250"><div id="" style="float:left;"><select class="select" id="teamH" name="teamH"><option>Choose Team</option></select></div></td>
<td width="100" align="center" colspan="3">
<select class="select" id="leagueChoice" name="league" onchange="leagueABCD('findleague.php?league='+this.value)">
<option>Select your division first</option>
<option value="a" id="divisionA">A League</option>
<option value="b" id="divisionB">B League</option>
<option value="c" id="divisionC">C League</option>
<option value="d" id="divisionD">D League</option>
</select>
</td>
<td width="250"><div id="" style="float:left;"><select class="select" id="teamV" name="teamV"><option>Choose Team</option></select></div></td>
<td width="100" align="center"><strong>Visitor</strong></td>
</tr>
<tr>
<td width="100" align="center"><strong>Player / ID#</strong></td>
<td width="220" align="center"><strong>Highlights</strong></td>
<td width="73" align="center" style="padding:2px;"><strong>W</strong></td>
<td width="74" align="center"><strong>Game</strong></td>
<td width="73" align="center" style="padding:2px;"><strong>W</strong></td>
<td width="220" align="center"><strong>Highlights</strong></td>
<td width="100" align="center"><strong>Player / ID#</strong></td>
</tr>
</table>
</div>
When a league is chosen it brings in this findleague.php :
<?php
$league=$_GET['league'];
//echo $league;
include("sparkplug2.php");
$result = mysql_query("SELECT DISTINCT(team) FROM member_data2011spring WHERE division = '$league' ORDER BY team ASC") or die(mysql_error());
$result2 = mysql_query("SELECT DISTINCT(team) FROM member_data2011spring WHERE division = '$league' ORDER BY team ASC") or die(mysql_error());
?>
<div id="league">
<table width="100%" border="1" cellspacing="4" cellpadding="0" id="myTable2" style="background-color:#ffffff;">
<tr>
<td width="100" align="center"><strong>Home</strong></td>
<td width="250">
<div id="" style="float:left;">
<select class="select" id="teamH" name="teamH" onchange="homeTeam('findhomeplayer.php?teamH='+this.value)">
<option>Choose Team</option>
<? while($row=mysql_fetch_array($result)) { ?>
<option value="<?=$row['team']?>"><?=$row['team']?></option>
<? } ?>
</select>
</div>
</td>
<td id="leagueChoice" width="100" align="center" colspan="3">
<strong><?php echo strtoupper($league); ?> League</strong>
</td>
<td width="250">
<div id="" style="float:left;">
<select class="select" id="teamV" name="teamV" onchange="visitingTeam('findvisitingplayer.php?teamV='+this.value)">
<option>Choose Team</option>
<? while($row=mysql_fetch_array($result2)) { ?>
<option value="<?=$row['team']?>"><?=$row['team']?></option>
<? } ?>
</select>
</div>
</td>
<td width="100" align="center"><strong>Visitor</strong></td>
</tr>
<tr>
<td width="100" align="center"><strong>Player / ID#</strong></td>
<td width="220" align="center"><strong>Highlights</strong></td>
<td width="73" align="center" style="padding:2px;"><strong>W</strong></td>
<td width="74" align="center"><strong>Game</strong></td>
<td width="73" align="center" style="padding:2px;"><strong>W</strong></td>
<td width="220" align="center"><strong>Highlights</strong></td>
<td width="100" align="center"><strong>Player / ID#</strong></td>
</tr>
</table>
</div>
<!--PLACEHOLDER FOR HOME TEAMS PLAYERS-->
<div id="playersHomeTeam" style="float:left; width:370px; border:none;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td> </td>
</tr>
</table>
</div>
<!--INSERTS 'A LEAGUE' MATCH DATA-->
<?php require_once($_SERVER['DOCUMENT_ROOT'].'/reports/inc/a_league.php'); ?>
<!--PLACEHOLDER FOR VISITING TEAMS PLAYERS-->
<div id="playersVisitingTeam" style="float:left; width:370px; border:none;">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td> </td>
</tr>
</table>
</div>
Help please.
TIA,
rad1964