Script API Tutorial

Changing separate validation message

Validation is a process of data verification. When Cool Tool detects that no answer was given to a question, it raises “Answer is required” message. You can change the text of this message for the whole Questionnaire in “Manage languages” tab. However, if you need to customize it only for one specific question, you can use a simple script described below.

In order to reproduce this example, please undertake the following steps:

Go to Questionnaire editor and create a “Single Answer” question with several alternatives. Then launch the Script Editor and insert the following script into “OnValidate script” tab (see the image below)

  • var answers = this.get();
  • if (answers.length==0)
  • return "Custom Message";

Replace Custom Message string by the message you want to be displayed to Respondent.

Learn more at CoolTool knowledge base