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

Radio buttons aren't used properly in forms

    XMLWordPrintable

    Details

      Description

      Radio buttons are supposed to be created as sub-elements of a single form element, as documented here:

      http://docs.moodle.org/dev/lib/formslib.php_Form_Definition#radio

      If you search Moodle's codebase you'll see this isn't used:

      git grep -e addElement --and -e radio

      Instead each radio button is added directly to the form as it's own form item with a blank label and an extra heading added above it. This still works because the same id is used for each radio button so they're treated as part of a set by the browser. But it looks ugly, particularly if you set each of them as required fields.

      It also interferes with the responsiveness of the forms, since that code treats them all as indivdual form items and headings.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: