diff --git a/lib/formslib.php b/lib/formslib.php index e816da6..e5bb215 100644 --- a/lib/formslib.php +++ b/lib/formslib.php @@ -873,12 +873,20 @@ abstract class moodleform { * Print html form. */ function display() { + echo $this->html(); + } + + /** + * Retrive form html. + */ + function html() { //finalize the form definition if not yet done if (!$this->_definition_finalized) { $this->_definition_finalized = true; $this->definition_after_data(); } - $this->_form->display(); + + return $this->_form->toHtml(); } /**