Good evening everyone, first to say that I am new to using kobotoolbox, second that my English is bad, I will try to be as clear as possible.
I am working on the form builder, looking at the documentation I have realized that my own code can be placed in the validation criteria, below I detail what I am trying to do:
I have three questions of type number: ${total}, ${numero1} and ${numero2}.
In the “total” question, you put a number, for example 10.
Then you must put two numbers in the other two questions (numero1 and numero2), the validation criteria for both must be the following: you cannot put numbers that, adding both questions, result in a number other than the “total” number, in this example 10.
the order of the questions are:
1- Total
2- Numero1
3- Numero2
I have placed the code that I will show below in the question ${numero1}
if(${numero2}!=“”, ${numero1} + ${numero2} == ${total},“”)