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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.0
    • Fix Version/s: None
    • Component/s: User management
    • Labels:
      None
    • Affected Branches:
      MOODLE_30_STABLE

      Description

      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?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jethac Jetha Chan
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: