Moodle - Insert html in between form fields -
scenario:-
in moodle have form created uses
$mform->addelement('hidden', 'category', $category->id);
to insert fields form.
i want insert table in middle of form.
for example. have form fields user name, emp code , contact number. want insert table between emp code , contact name. table have data user has inputted.
i have way insert table @ end of page using :-
echo $output->header(); echo $output->heading($pagedesc); $table = new html_table(); $table->head = array('name', 'emp code','contact number'); echo html_writer::start_tag('div', array('class'=>'no-overflow')); echo html_writer::table($table); echo html_writer::end_tag('div'); echo $output->footer();
please suggest way insert table in middle of form.
you can add html form element - https://docs.moodle.org/dev/lib/formslib.php_form_definition#html
$mform->addelement('html', $output);
Comments
Post a Comment