Fork me on GitHub

html_options questions  Bottom

  • Hi,

    I've got my dropdown box filled with data from the database, but I have one question. How do I stop the html_options function from making the dropdown an optgroup ? Here is my code to build the array:

    Quote


    $system_list = array();
    $rs->MoveFirst();
    if (!$rs->EOF) {
    while(list($sid, $name) = $rs->fields) {
    $system_list[] = array($sid => $name);
    $rs->MoveNext();
    }
    }



    Here is my code in the htm page:

    Quote


    <select name="system_id"></select>


    Everything works perfectly except I get index numbers of the groups due to it being converted to an optgroup.

    I'm new to this so any help is appreciated. Could I set up my array differently? Use html_options differently? Use another function?
  • It looks like your forming your array in a way html_options doesn't like - take a look at the html_options docs for more info.

    -Mark

    --
    Visit My homepage and Zikula themes.
  • markwest

    It looks like your forming your array in a way html_options doesn't like - take a look at the html_options docs for more info.

    -Mark


    I thought so. I will review it again :D
  • 0 users

This list is based on users active over the last 60 minutes.