Reply To: Cascading drop down lists

Home Forums Quform PHP Cascading drop down lists Reply To: Cascading drop down lists

#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 -->
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy