Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-6914 formslib.php improvement
  3. MDL-7778

Add Cancel button hooks to standard moodleform

XMLWordPrintable

    • Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: Major Major
    • 1.8
    • 1.8
    • Forms Library
    • None
    • MOODLE_18_STABLE
    • MOODLE_18_STABLE

      The cancel button is not easy to create correctly. We should help developers to write forms with cancel buttons without ugly hacks that rely on JS and can not be used without it.

      Solution:
      1/ add cancel button element type
      2/ add cancelled() method to moodleform class

      expected use:

      $mform = new someform();

      if ($mform->cancelled()) {
      redirect($somewhere);
      } else if ($data = $mform->data_submitted()) {
      ...
      }

            skodak Petr Skoda
            skodak Petr Skoda
            Nobody Nobody
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.