I am developing a new module.
Each time I reload the module page I have to pass through a GET the parameters $id and $cm otherwise the view.php doesn't let me get in.
I want to add a form into my view.php
I want to use moodle forms.
I enter a standard form with just one filed (following the instruction found in http://docs.moodle.org/en/Category:Formslib). The simpler you like, for instance (to let you understand):
<?php
require_once ($CFG->dirroot.'/lib/formslib.php');
class mod_studing_entry_form extends moodleform {
function definition() {
$mform =& $this->_form;
// edit field: dogname
$mform->addElement('text', 'dogname', get_string('dogname_label', 'studing'), null);
$mform->addRule('dogname', get_string('required'), 'required', null, 'client');
$this->add_action_buttons($cancel = true, $submitlabel=null);
}
}
Now I push the submit (or the cancel) button and... the form sends data through a POST so... the view.php page doesn't reload but shows the standard error: "Course module is incorrect"
How can I solve the problem?
Thank you in advance.
Fantastic. In these forums if a user already has the information he/she needs or if he/she asks for it, it is the same. He/She can proceed in just a clock tick.
Thank you Tim.
Thank you Tim.