Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-3879

Add customizable validation message to controls

XMLWordPrintable

      The "default" validation message is too general to be helpful for editors. Especially when the validation involves things like a 25 character limit, the message should really point out what is wrong ("Your input is too long. Please use a maximum of 25 characters.").

      We use the field description to inform the user about the expected format, but people still make mistakes, and are then confused by the generic validation message.

      This is particularly important when setting validationPattern on a ckEditor field. Since the (invalid) field contents are echoed in the message, and ckEditor fields typically have long content (and in HTML), the standard validationMessage does not fit in the javascript dialog, and is completely incomprehensible to the end user.

      It would be a nice (and easy to add) feature to allow customizing of the validation message, to complement the validationPattern setting.

      Solution:

      add a "validationMessage" property to controls (info.magnolia.cms.gui.dialog.DialogControlImpl).

      If the validation fails for the validationPattern, the control would then show the supplied validationMessage in the alert.

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              runger Richard Unger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD