Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: Frank Ralf/Semantic HTML5.

User:Frank Ralf/Semantic HTML5: Difference between revisions

From MoodleDocs
Line 11: Line 11:
     'TEACHER',
     'TEACHER',
     'Mr. Smith',
     'Mr. Smith',
     '',                       
     'History',                       
     array('class'=>'pe_teacher', 'id'=> 'SMITH')
     array('class'=>'pe_teacher', 'id'=> 'SMITH')
     );
     );
Line 19: Line 19:
     'teachers',   
     'teachers',   
     'Ms. Miller',
     'Ms. Miller',
     '',                         
     'Math',                         
     array('class'=>'pe_teacher', 'id'=> 'miller')  
     array('class'=>'pe_teacher', 'id'=> 'miller')  
     );
     );

Revision as of 19:57, 15 June 2009

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>

</fieldset>