Geting information from a Moodle form

Geting information from a Moodle form

by Jose Velazquez-Torres -
Number of replies: 1

Hello!!

Im creating a custom form to reschedule an activity under specific paramaters. I already created the form but Im having issues reading the information gather in the form, specialy the date, for that Im using the date_time_selector element. 

if ($mform->is_cancelled()) {

        //Handle form cancel operation, if cancel button is present on form

        redirect(new moodle_url($CFG->wwwroot . '/course/view.php?id=' . 2));

    } else if ($fromform = $mform->get_data()) {

        //In this case you process validated data. $mform->get_data() returns data posted in form.

        $activityname = $fromform->mytime;

        echo 'this ' . $activityname . ' ';

    }

Here Im trying to display the value and I get numeric code and not the actual date and time values. I need this values to update the parameters in the data base table. Could someone point me in the right direction or tell me what Im missing to achive this?

Average of ratings: -