by Davo Smith.
If you want two forms on one page, just create two Moodle form objects, do all the usual cancel / get_data checks on them (one after the other), then output them both. e.g.:
if ($form1->is_cancelled()) { ... }
if ($data = $form1->get_data()) { ... }
if ($form2->is_cancelled()) { ... }
if ($data = $form2->get_data()) { ... }
$form1->display();
$form2->display();
As for clearing forms when they are submitted, the easiest way is to finish the data processing section of the form with:
redirect($PAGE->url); // Or manually generate a suitable moodle_url
This will wipe out all the POST vars from the page and leave users with a nice clean form to work with.
Davo