hi guys, need your expertise...
I'm trying to create a list for group of associates by group and when a group is selected the associates assigned to that group will appear in a list
sample
when user select a group then it will display the names of the selected group members (the above code works fine)
Note: I would like to do this without hitting the submit button just like how other website do their country,state drop down list. I don't mind having the list to submit itself
i have tried some examples from the net but its not working
I'm trying to create a list for group of associates by group and when a group is selected the associates assigned to that group will appear in a list
sample
Code:
<select name="groupName">
<?php $rs_groupSearch="SELECT * FROM tblGroup";
$groupCount=mysql_num_rows($rs_groupSearch);
if($groupCount>0){
while($Groups=mysql_fetch_array($rs_groupSearch)){
?>
<option><?php echo $Groups['GroupName']; ?></option>
<?php } else { ?>
<option>No Groups in List</option>
<?php } ?>
</select>
Code:
<select name="groupMembers" size="4">
<?php $rs_groupMemberSearch="SELECT * FROM tblGroupMembers
WHERE GroupName='$groupName'"; //This is where i'm stuck
//$groupName is the name of list box above i don't know
//how to parse the value from that list to this sql
$groupMemberCount=mysql_num_rows($rs_groupMemberSearch);
if($groupMemberCount>0){
while($GroupMembers=mysql_fetch_array($rs_groupMemberSearch)){
?>
<option><?php echo $Groups['MemberName']; ?></option>
<?php } else { ?>
<option>No Members in List</option>
<?php } ?>
</select>
i have tried some examples from the net but its not working
Comment