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

Modals containing form elements should always be wrapped in a form

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6, 3.7
    • Fix Version/s: None
    • Component/s: HTML and CSS
    • Labels:
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE

      Description

      There are examples in core where we have put form elements in a modal dialog, but the form elements are not contained in an actual form.

      It doesn't matter if the action is performed by ajax or not - form elements are required to be associated with a form and this will affect screen reader behaviour.

      This affects MDL-64331 because we close a modal if you click outside it and the modal does not contain a form. The reasoning for this is that if you are filling out a form, you might lose data if the modal is closed with no warning, but if there is no form it is a better experience to just dismiss the modal window.

      Listing 3.6 here because MDL-64331 will be added to that version.

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              damyon Damyon Wiese
              Participants:
              Component watchers:
              Amy Groshek, David Scotson, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: