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

Javascript validation errors if rules set for mforms editor


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Forms Library
    • Labels:
    • Affected Branches:


      When using the new mforms editor element in conjunction with rules most notably making the field required validation fails due to a JavaScript error.
      The problem is very easy to diagnose in that the generated validation routine is been called with the name of the element as set when creating the element. However the editor creates it primary element as name[text], thus the arg passed to the validation routine is undefined and as the JS there is particularly shotty the whole validation for the form falls over.

      To duplicate this:
      Using Firefox + the Firebug extension and JavaScript debugging enabled simply log into any course, turn on editing and attempt to create new module.
      The introeditor is a required field and when you attempt to submit Firebug will fire up and detect the JavaScript error as part of the validation for the editor.

      Solution: I couldn't think of any nice way to solve this one short of making ugly hacks in the functions that build the validation JS, or making major changes to either the mforms editor element of the way in which mforms generates JS as a whole.....

        Gliffy Diagrams


            Issue Links



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


                  • Created: