how to get selected value from select field?

how to get selected value from select field?

by Amal k -
Number of replies: 0

Hi

i have a form with select field. and it contains some course name. like follows


foreach($coursename as $course)

                {

                    $options1[$course->id] = $course->fullname;

                }

$mform->addElement('select', 'course', get_string('course','local_user'), $options1);

course name is selected from database and assign it to select field. But when i change the value of select field. i want to store the changed value in a variable.

how do i do that?

Average of ratings: -