简体   繁体   中英

get value of php dropdown with javascript

<?php

    $apart_infos_list = $this->d->get_list_apart_infos(); 

    $apart_infos  = array('' => 'Επιλέξτε κατηγορία');

    foreach ($apart_infos_list as $apart_info) {


          $apart_infos[$apart_info] = $apart_info;

      }      

     echo form_dropdown

      ('',$apart_infos,'','name="txt_apart_info" class="form-control"'); 

?>

get option value:

var e = document.getElementById(id_of_select);
if (e)
{
    $value = e.options[e.selectedIndex].value;
    ....
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM