I am developing an entry form for a competition which at its simplest does the following:
1. User selects club from dropdown
2. User selects member id (CRN) from dropdown filtered by selected club
PHP is not my first language and while I know exactly how I would write this in VB, I am struggling with setting the club id as a variable to filter and requery the team member ids belonging to that club. I have been searching and reviewing topics to find a solution but have thus far been unsuccessful. I apologize in advance if the solution has already been posted somewhere here!
Thank you in advance!
Liz
1. User selects club from dropdown
2. User selects member id (CRN) from dropdown filtered by selected club
PHP is not my first language and while I know exactly how I would write this in VB, I am struggling with setting the club id as a variable to filter and requery the team member ids belonging to that club. I have been searching and reviewing topics to find a solution but have thus far been unsuccessful. I apologize in advance if the solution has already been posted somewhere here!
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">Club</label>
<select class="cf_inputbox" id="select_1" size="1" title="" name="Club">
<option value="">Choose Option</option>
<?php
$db =& JFactory::getDBO();
$query = "
SELECT Club
FROM jos_chronoforms_frmFBClub ;
";
$db->setQuery($query);
$column= $db->loadResultArray();
?>
<?php
foreach ($column as $value)
{
echo '<option>'.$value.'</option>';
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_dropdown">
<label class="cf_label" style="width: 150px;">CRN</label>
<select class="cf_inputbox" id="select_2" size="1" title="" name="CRN">
<option value="">Choose Option</option>
<?php
$db =& JFactory::getDBO();
$query = "
SELECT CRN, Club
FROM jos_chronoforms_frmFBDogs ;
";
$db->setQuery($query);
$column= $db->loadResultArray();
?>
<?php
foreach ($column as $value)
{
echo '<option>'.$value.'</option>';
}
?>
</select>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_3" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
Thank you in advance!
Liz