The cases are as follow:
- Top of Mind, first box mandatory
- Numerical Validation
- Numerical Validation with Suffix or Preffix
- Suffix or Prefix
- 100% Validation
- Array Filtering
- Array Filtering with numeric validation
- Array Filtering with Numerical Validation with Suffix or Preffix
- Array Filtering with Suffix or Preffix
- Array Filtering with Percentages 100% Validation
Many of these cases will share the same code, so here, I’ll explain what the main variables do:
let questionCode = "Q2"; | This is the code of the question. It needs to be replaced with the question |
let emptyValue = 0; | This value will be set where respondents don’t answer, if not all fields are required |
let emptyFields = true; | This will verify if the respondent has to enter an answer on all fields. Set true if all are required |
Case 1 Top of mind, first box mandatory
Copy the code of the following question.
- 109752 - JS Code Multiple Open Text - Q1
Top of mind set as true will only require the first input field
Case 2 Numerical Validation
These questions will only accept whole numbers. You can configure the lenght and/or the minimun and maximun values of these answers with the code in question:
- 109752 - JS Code Multiple Open Text - Q2
Case 3 Suffixes and Prefixes
Copy the code from:
- 109752 - JS Code Multiple Open Text - Q4
The variable "typeOfText" has to be either "preffix" or "suffix". This will determine what will be added. The same applies in the following case.
Case 4 Suffixes and Prefixes with numerical validation
Copy the code from:
- 109752 - JS Code Multiple Open Text - Q3
Case 5 100 % validation
This type of question will require respondents to enter a total sum of 100, distributed among a list of options. You may add as many fields as you like. This will also add a percentage suffix.
This type of question will only accept whole positive numbers.
If the sum of the answers isn’t 100, the respondent will not be able to continue
If you don't want to include 0's make it not required and change variable empty value with ""
You need to copy the code from
- 109752 - JS Code Multiple Open Text - Q5
Case 6 Array Filtering
This is a standard array filter, but applied to a multiple open text format. As you know, you will need your previous filter question and its schema:
Once this is done, copy the code of question:
- 109752 - JS Code Multiple Open Text - Q7
Case 7 Array filtering with numeric validation
This will combine an array filter, with the numeric validation. Just as the last numeric validation, it will only accept positive whole numbers
Copy the code of question:
- 109752 - JS Code Multiple Open Text - Q8
Case 8 Array filtering with numeric validation and suffix/preffix
Now let’s combine all we have previously mentioned.
Copy the code of question:
- 109752 - JS Code Multiple Open Text - Q9
Case 9 Array filtering with suffix/preffix
Copy the code of question, specify the text that will be shown and whether it will be the preffix or suffix:
- 109752 - JS Code Multiple Open Text - Q10
Case 10 Array filtering with 100% numeric validation
This will combine the functions of the 100% numeric validation and array filter. Don’t forget the filter question
Copy the code of question:
- 109752 - JS Code Multiple Open Text - Q11