How do I create two forms that can be executed using a single submit button in moodle

Re: How do I create two forms that can be executed using a single submit button in moodle

by Davo Smith -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
You can either use the standard Moodle form collapsible headings by putting:
$mform->addElement('header', 'name_for_your_header', get_string('headername', 'myplugin'));
before each part.

Or, if you really need a custom div, use HTML elements:
$mform->addElement('html', '<div class="some-css-class">');
$mform->addElement('text', 'name', get_string('name')); 
$mform->setType('name', PARAM_NOTAGS);                   
$mform->setDefault('name', 'Please enter name'); // Make sure you fix this to use a language string, not hard-coded text.
$mform->addElement('html', '</div>');

Average of ratings: Useful (1)