Skip to end of banner
Go to start of banner

Validators - Example 2

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

We've encountered an issue exporting this macro. Please try exporting this page again later.
string errorMsg = "You must enter a comment!";
if(!hasInput("comment")) {
   return false, "comment", errorMsg;
}

Because the second parameter (optional) was used in this example the error message will also display beneath the comment field.

When using transition screens be sure to use routines that can read screen values like hasInput() or getInput() otherwise the script will retrieve the value (if any) stored in the issues and not the value the user just input into the field and is trying to save.

  • No labels