adding options to listbox using moodle

adding options to listbox using moodle

by Aditi Thombre -
Number of replies: 0

I have a table with several columns and i want  to fetch one column out of it in a listbox . If I use  code below then It creates   seperate list-box for every record...ERROR  . I want all the records in one list box

Is there any function as $mform->addOption() to add options in list box

foreach($cuname as $cu)
   { 
   
$mform->addElement('select','type', get_string('type'),array($cu->username));

    } 

Average of ratings: -