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

MoodleQuickForm client side validation javascript failure when element name contains a dash (-)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.3.4, 2.4.1
    • Component/s: Forms Library
    • Labels:
    • Testing Instructions:
      Hide

      Create a Moodle form with a text element named 'field_-1' and a 'required' rule on the element.
      Open the form, leave the text field empty and submit.

      Expected: The form should not be submitted and an error message 'You must supply a value here.' should appear above the field.

      Show
      Create a Moodle form with a text element named 'field_-1' and a 'required' rule on the element. Open the form, leave the text field empty and submit. Expected: The form should not be submitted and an error message 'You must supply a value here.' should appear above the field.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-36433-master

      Description

      MoodleQuickForm client validation javascript failure when element name contains a dash . Dashes are not allowed in javascript variable/function names and have to be escaped but are not escaped in getValidationScript. Consequently, the call to rule validation scripts for such elements fails and client side validation is not performed.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    14/Jan/13