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

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

XMLWordPrintable

    • MOODLE_23_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MDL-36433-master
    • 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.

      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.

            itamart Itamar Tzadok (Inactive)
            itamart Itamar Tzadok (Inactive)
            Sam Hemelryk Sam Hemelryk
            Rajesh Taneja Rajesh Taneja
            Votes:
            1 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.