How can I use cfloop or query my database so I can select home game and away game for multiple selections. I need to select 1 selection for home and away game but have to be able to select 1 of each. here is my output
http://67.219.102.67/wcfootball/index2.cfm
<script language="JavaScript" type="text/JavaScript">
<!--
function uncheckRadio() {
var choice = document.form1.RadioGroup1;
for (i = 0; i < choice.length; i++) {
if ( choice[i].checked = true )
choice[i].checked = false;
}
}
//-->
<script language="JavaScript">
function checkRegex(object_value, regex) {
return regex.test(object_value);
}
function validateform (f) {
if (f.Team1.checked == false && f.Team2.checked == false ) {
alert("Please select at least one type of service you are interested in.");
return false;
} else if (f.Team1.checked == true && f.Team2.checked == true ) {
alert("You Must Select only Economy Buster or Lawn Treatment Please un-check one.");
return false;
} else if (f.Team1.value == "") {
alert("Please enter your first name.");
return false;
} else if (f.Team2.value == "") {
alert("Please enter your last name.");
return false;
}
return true;
}
function doValidateForm() {
if (validateform(document.frmTeam)) document.frmTeam.submit();
}
</script>
<cfquery name="Get_members" datasource="#application.dsn#">
SELECT * FROM members
</cfquery>
<table cellspacing="0" cellpadding="0" border="0" width="523">
<cfoutput>
<table cellspacing="0" cellpadding="0" border="0">
<tr>Name<br></td>
<td class="infoBoxShaded">#get_members.first_name# #get_members.last_name#</td>
</tr>
<tr>
<td class="infoBoxShaded">#get_members.address# #get_members.city# #get_members.zip#</td>
<td class="infoBoxShaded"><img src="images/spacer.gif" width="20" height="1" alt="" border="0"></td>
<td class="infoBoxShaded"></td>
<td class="infoBoxShaded" colspan="3"></td>
</tr>
<tr>
<td class="infoBoxShaded">SCORE: #get_members.score#</td>
<td class="infoBoxShaded"><br><br>#session.sessionID#</td>
<td class="infoBoxShaded" colspan="5"></td>
</tr>
</table>
</cfoutput>
</table>
<p> </p>
<p><strong>Week 1</strong></p>
<tr>
</tr>
<cfform action="getEstimate_step2.cfm" method="post" name="frmWon">
<input type="Hidden" name="action" value="continue">
<table border="0" cellpadding="1" cellspacing="0" bordercolor="#000000" width="45%">
<tr>
<td><div class="content_black">Game</div></td>
<td><div class="content_black">Week</div></td>
<td><div class="content_black">Home Team</div></td>
<td><div class="content_black">Away</div></td>
<cfquery name="Picks" datasource="#application.dsn#">
SELECT distinct Games.game, games.week, games.home_team, games.away_team FROM Games
where games.week = '1'
</cfquery>
</tr>
<cfloop query="Picks">
<cfoutput>
<tr>
<td><div class="content_black">Game #Game# </td>
<td><div class="content_black">Week #Week# </td>
<td><div class="content_black"><cfinput type="radio" name="mainloop" value="1" required="yes" message="Please select the right option">#Home_team# </td>
<td><div class="content_black"><cfinput type="radio" name="mainloop" value="0" required="yes" message="Please select the right option">#Away_team# </td>
</tr>
</cfoutput>
</cfloop>
<INPUT type="submit" name="mysubmit" value="Submit">
</cfform>
</table>