Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-17553

mform: unable to create Cancel button

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 1.8.7
    • Forms Library
    • None
    • MOODLE_18_STABLE

      Reproduce:

      I wanted to prepare a custom mform where the Cancel button precedes the Submit - it is a classic wizard form:
      [ < Cancel ] [ Continue > ]

      The Cancel button inherits from Submit button class. But the file submit.php is not properly included so missing class error arises.

      The code:

      $buttonarray=array();
      $buttonarray[] = &$mform->createElement('cancel', 'cancelbutton', get_string('cancel'));
      $buttonarray[] = &$mform->createElement('submit', 'submitbutton', get_string('continue'));

            mudrd8mz David Mudrák (@mudrd8mz)
            mudrd8mz David Mudrák (@mudrd8mz)
            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.