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

formslib disabledif can only do 'or' logic, not 'and'

XMLWordPrintable

    • MOODLE_23_STABLE

      On the quiz editing form, we would ideally disable the 'When time expires' option if (time limit == 0) AND (close date == 0).

      Sadly, the only type of code that is possible (without writing custom JavaScript) is

      $mform->disabledIf('overduehandling', 'timelimit', 'eq', 0);
      $mform->disabledIf('overduehandling', 'timeclose', 'eq', 0);

      Which will disable 'overduehandling' if either condition is true.

      It would be nice to support the AND option, but there is not an obvious simple API design.

            Unassigned Unassigned
            timhunt Tim Hunt
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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