Home › Forums › Quform PHP › Cascading drop down lists › Reply To: Cascading drop down lists
April 27, 2019 at 7:03 pm #29173
waubain
Participant
I figured out a solution. I built a plain select input in the php file which was then returned to the QuForm element.
Since I am a beginner, improvements are welcome.
Thanks.
php file
//array not shown
if ( isset( $_GET['id'] ) && !empty( $_GET['id'] )){
$mdate = $_GET['id'];
}
echo '<select>';
echo '<option value="">Choose a speaker</option>';
$speakers = array();
foreach($info_decoded as $row) {
if (($row['meetdate']) == $mdate) {
$speakers[] = $row['speaker'];
}
}
foreach($speakers as $item){
echo '<option value="' . $item . '">' . $item . '</option>';
};
echo '</select>';
form php
<!-- Begin Speaker Select element -->
<div class="quform-element quform-element-select quform-huge">
<div class="quform-spacer">
<label for="speaker">Speaker<span class="quform-required">*</span></label>
<div class="quform-input">
<select class="quform-tooltip" id="speaker" name="speaker" title="Speaker">
<option value="">Choose meeting date first!</option>
</select>
</div>
</div>
</div>
<!-- End Speaker Select element -->