Jump to content


Photo

A Point in the RIGHT DIRECTION!!


  • Please log in to reply
4 replies to this topic

#1 pikemsu28

pikemsu28
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts

Posted 19 September 2006 - 02:25 PM

I need a point in the right direction!!!!!

I have a form that has two sets of radio button groups being displayed dynamically.  I want the second group to display information depending on the radio that was selected in the first group.

EXAMPLE:

Group 1                  Group 2

Clinical                  If Clinical Display: Team 1
                                                    Team 2
Non Clinical            If Non Clinical Display: Team 1
                                                          Team 2
                                                          Team 3
General                  If General Display: Team 1
                                                    Team 2
                                                    Team 3
                                                    Team 4

If someone could point me in the right direction on this it would greatly be appreciated.

Thanks, Jason

BTW I'm using Dreamweaver to code my PHP and using some PHP Built in functions of Dreamweaver.

#2 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 19 September 2006 - 03:01 PM

Give us some of your code now so we can see what you have.
Ray

#3 pikemsu28

pikemsu28
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts

Posted 19 September 2006 - 03:14 PM

<?php
mysql_select_db($database_Nursing, $Nursing);
$query_teams = "SELECT team FROM teams";
$teams = mysql_query($query_teams, $Nursing) or die(mysql_error());
$row_teams = mysql_fetch_assoc($teams);
$totalRows_teams = mysql_num_rows($teams);

$x = 0;
do { 
$team[$x] = $row_teams['team'];
$x++;
} while ($row_teams = mysql_fetch_assoc($teams));
?>
<form method="post" name="teams" id="teams" onSubmit="return checkRadios(this);">
<table width="250" align="center" border="1">
<tr>
<td><?php for ($y = 0; $y < $totalRows_teams; $y++) { ?>
<label>
<input type="radio" name="team" value="<?php echo $team[$y]; ?>" />
<?php echo $team[$y]; ?></br></label>
<?php } ?>
</td>
</tr>
<tr align="center">
<td><input name="submit" type="submit" class="bluebox" id="submit" value="Submit" />
<input name="reset" type="reset" class="bluebox" id="reset" value="Reset" />
</td>
</tr>
</table>
</form>

This code generates the first radio group through the sql query.  How do i get this code to display the second radio group?  I know how to do the form and the loop, just how to get this radio group to dynamically populate once the first radio group is selected.

#4 craygo

craygo
  • Staff Alumni
  • Advanced Member
  • 1,973 posts
  • LocationRhode Island

Posted 19 September 2006 - 03:26 PM

how are the groups defined in the table. Do you have a group id or something???

Ray

#5 pikemsu28

pikemsu28
  • Members
  • PipPipPip
  • Advanced Member
  • 164 posts

Posted 19 September 2006 - 04:39 PM

1st group:
<input type="radio" name="team" id="team" value="<?php echo $team[$y]; ?>" />

2nd group:
name="team_assign"

since i last posted my code i did add the id="team" into my code.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users