MDL-19976 Refactored select_menu() into select(), now supporting menu, radio and checkbox rendering. Added radio() and checkbox() functions.
This commit is contained in:
@@ -210,15 +210,15 @@ function lockoptionsallsetup(formid) {
|
||||
* submits the form designated by args.id. If args.selectid is also
|
||||
* given, it only submits the form if the selected <option> is not
|
||||
* the first one (usually the "Choose..." option)
|
||||
* Example usage of the moodle_select_menu component with this function:
|
||||
* Example usage of the moodle_select component with this function:
|
||||
* <pre>
|
||||
* $selectmenu = new moodle_select_menu();
|
||||
* $selectmenu->options = array('delete' => get_string('delete'));
|
||||
* $selectmenu->name = 'action';
|
||||
* $selectmenu->button->label = get_string('withselected', 'quiz');
|
||||
* $selectmenu->id = 'menuaction';
|
||||
* $selectmenu->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
|
||||
* echo $OUTPUT->select_menu($selectmenu);
|
||||
* $select = new moodle_select();
|
||||
* $select->options = array('delete' => get_string('delete'));
|
||||
* $select->name = 'action';
|
||||
* $select->button->label = get_string('withselected', 'quiz');
|
||||
* $select->id = 'menuaction';
|
||||
* $select->add_action('change', 'submit_form_by_id', array('id' => 'attemptsform', 'selectid' => 'menuaction'));
|
||||
* echo $OUTPUT->select($select);
|
||||
* </pre>
|
||||
*/
|
||||
function submit_form_by_id(e, args) {
|
||||
|
||||
Reference in New Issue
Block a user