Questions Menu - Validate on Constant Sum

The Validate on Constant Sum function puts custom validation onto the page that adds the sum of several write-in number fields. This function can be applied the maximum of once per page of the survey.
  1. Select any one of the questions you are working with. Select Questions Validate on constant sum.
  2. You will see a list of the write-in number questions. Select the questions you want to include in your sum.
  3. Enter the minimum and maximum values.
  4. Press Save when you are done.
  5. To remove the function, select Yes from Do you want to remove this from the form?

And example of a question set that would use this features might be:

The minimum and maximum values would be set to 100 for this example. When the online user enters their values, they will only be able to continue when the sum of the three add up to 100.

Example:

The validate on constant sum feature finds the sum of a group of write-in number questions and determines whether the user may or may not continue. This feature works on multiple pages but only once per page. (A custom script can be written for multiple validation groups on one page.)
  1. Create a survey with several write-in number questions. On the this sample, we have three pages with 4 write-in number questions on page one and page two; page three is the end page. We are going to be validating A, B, C, and D in a group on page one and E, F, G, and H in a group on page two.
  2. Select one of the write-in numbers in the first group.
  3. Then select Validate on constant sum, the Validate on Sum window will open and it will show all of the write-in questions on the selected page. In this case, we have A, B, C, and D. The window also has the minimum and maximum accepted values option. These values indicate the numeric range by which the selected questions can sum to.
  4. In this sample I want all of the write in questions to be in my group and I want the sum to add up to 100. Press Save.
  5. The Section break for the page will be updated with a warning text that will show only when the userís answers don't add up to our value. This text can be put anywhere on the page. Also, the validation file has been updated to calculate the total sum of this group

Setup Validate on constant sum for page two

  1. Select one of the write-in questions on the second page. Select the Validate on constant sum option.
  2. On this page we are selecting all of the questions to be in the group and we are setting the minimum accepted value to 3 and the maximum accepted value to 5. Press Save.

Seeing the results

  1. After you publish the form, enter some numbers into the write-in number fields. In this case we entered 99, 0, 0, and 0 to show you that when Next is pressed, an error shows on the screen. By default the error will say: The sum must be between [min] AND [max]. This message can be changed to say anything and may be put anywhere on the page.
  2. The second page is similar to the first page except that the acceptable sum is different. On this page we specified three as the minimum accepted value and five as the max. The sum of the numbers in the fields must add up to between three and five.

Removing the group from a page

  1. Select a write in number question on the page you want to remove it from
  2. Unselect all of the questions and remove the entries from the minimum accepted value option and maximum accepted value option and select Yes for the option Do you want to remove this from the form? Press Save.

See also...