formslib - checkboxes
Styling forms proves a bit difficult due to the way formslib.php renders the individual form items. Let's look a an example.
Example PHP
$mform->addElement('header', 'checkboxes', get_string('checkboxtest', 'block_simpleblock'));
$mform->addElement(
'checkbox',
'TEACHER',
'Mr. Smith',
'History',
array('class'=>'pe_teacher', 'id'=> 'SMITH')
);
$mform->addElement(
'checkbox',
'teachers',
'Ms. Miller',
'Math',
array('class'=>'pe_teacher', 'id'=> 'miller')
);
Output HTML
(Only first form item shown.)
<fieldset class="clearfix" id="checkboxes">
<legend class="ftoggler">Checkbox Test</legend>
<label for="id_81c61d">Mr. Smith </label>
<input class="pe_teacher" id="id_SMITH" name="TEACHER" value="1" type="checkbox">
<label for="id_miller">Math</label>
</fieldset>