Hi there,
I have a form which has got many elements and each of those form elements when filled and submitted get stored in different database table.
So is there a way of just retrieving a specific form value and its data and store it in a table?
Like if I have
$mform->addElement('select', 'selectdepname', get_string('selectdepname', 'block_hierarchycreation'), $deplist);
$mform->addElement('text','sname', get_string('sname', 'block_hierarchycreation'), array('size' => 60));
In the above code my select menu is getting filled with values from another database table say table X
So firstly, is it important to name the form elements same as the database field names?
Secondly if I need to store 'sname' in a separate table, table Y and then take d newly inserted record's id (from Table Y) and the drop down menu's selected id from the table X and put those ids together in another Table Z, then how do I do it?
Hopefulyl this is not very difficult and I have referred the http://dev.moodle.org/mod/page/view.php?id=49 which shows step wise as to how create form and store data in a table.
But couldn't figure out how to retrieve specific form values and store it in different tables simultaneously wrt scenario I have mentioned above?
Any help is appreciated. Thanks ina advance.