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

Can't create a custom checkbox profile field with JS enabled

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    • 3.0
    • User management
    • None
    • MOODLE_30_STABLE

      On the User profile fields page (Site administration -> Users -> Accounts -> User profile fields), there's a select box labelled Create a new profile field - it is an autosubmit select box, i.e. it submits a form when the value in the select box changes.

      Unfortunately, the default value for it is a valid option - at time of writing it defaulted to "checkbox" - and because it defaults to a valid option, that option can never be submitted (you need to trigger a change event on the select box - going from checkbox to checkbox doesn't count as a change, and you can't change to something else first without inadvertently submitting the form).

      Affected browsers:

      • Affected: Chrome
      • Not yet tested: Firefox, Safari, IE9 - current

      Workaround
      With JS disabled, the select box no longer auto-submits.

      Potential solution
      Make the select box default to an invalid option, perhaps using get_string('choosedots').

      Perhaps this should be handled on a component level so contributors don't have to explicitly think about this?

            Unassigned Unassigned
            jethac Jetha Chan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

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