Missing label in a forms element

Missing label in a forms element

by Joseph Rézeau -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

At https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#addGroup the addGroup doc says:

"A 'group' in formslib is just a group of elements that will have a label and will be included on one line.
For example typical code to include a submit and cancel button on the same line :
$buttonarray=array();
$buttonarray[] =& $mform->createElement('submit', 'submitbutton', get_string('savechanges'));
$buttonarray[] =& $mform->createElement('submit', 'cancel', get_string('cancel'));
$mform->addGroup($buttonarray, 'buttonar', '', array(' '), false);
You use the same arguments for createElement as you do for addElement. Any label for the element in the third argument is normally ignored (but not in the case of the submit buttons above where the third argument is not for a label but is the text for the button). "

Why is the label ignored? I do need it in that case. Any workaround?

Average of ratings: -