Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Note
titleContent Freeze

As of July 25th, 2023, there is a content freeze on this page.

The pui.validate event, if defined, fires for each field that is modified on a Rich Display File screen and submitted back to the server.

...

Code Block
javascript
javascript

pui.validate = function(obj) {
  var invalidRegExp = new RegExp("[^A-Za-z0-9`-~!@#\\$%\\^&\\*\\(\\)_\\+\\{\\}\\[\\]\\|\\\\:;\"'<>,\\.\\?/ =]", "m");

  if (obj.dataType == "char") {
    // replace tab and quote characters pasted from MS Word with standard characters
    obj.value = obj.value.replace(/\t/g, " ");
    obj.value = obj.value.replace(/\u201C/g, "\"");
    obj.value = obj.value.replace(/\u201D/g, "\"");
    obj.value = obj.value.replace(/\u2018/g, "'");
    obj.value = obj.value.replace(/\u2019/g, "'");

    if (invalidRegExp.test(obj.value)) {
      return {
        "msg": "The field contains invalid characters."
      }
    }

  }

  return null;
}

...