Question T11288
Visible to All Users

Matrixdropdown with validation that should add to 100 does not consider it as complete

created 2 years ago (modified 2 years ago)

[Ticket cloned from T11276: matrixdropdown with validation that should add to 100 does not consider it as complete]

https://plnkr.co/edit/sJKEFtkyJfiuwzxj?preview

  1. Even though there is validation to be met for total to be 100 it still does not think that question is complete when 100% is met instead when I write 0 0 on the empty fields then it considers the question to be complete

2.a) is there a way to have question to be considered as complete if the validation is met? where it requires to fill up to 100?
so if one text box has 100 it doesn't need other rows to have 0 0 0 .

Answers approved by surveyjs Support

created 2 years ago

Hello,

Even though there is validation to be met for total to be 100 it still does not think that question is complete when 100% is met instead when I write 0 0 on the empty fields then it considers the question to be complete

I've tested your example (https://plnkr.co/edit/sJKEFtkyJfiuwzxj?preview), but didn't seem to find any validation.

is there a way to have question to be considered as complete if the validation is met? where it requires to fill up to 100?
so if one text box has 100 it doesn't need other rows to have 0 0 0 .|

You can setup the following validation rule for your question:

Code
"validators": [       {        "type""expression",        "text""The total schedule should be 100 %",        "expression""{question1.Row1.Column 1} + {question1.Row2.Column 1} + {question1.Row3.Column 1} + {question1.Row4.Column 1} + {question1.Row5.Column 1}= 100"       }

Please test the updated example.

For more information on data validation, refer to Data Validation.

Let me know if this validation rule works for you.