vicks88
September 24, 2021, 4:01am
1
@Kal_Lam
In the same manner, i have a similar query.
I want to restrict user to enter value greater than 0.6 in the response field.
like
Acceptable values
0.6
1.55
2.58
9.04
Not acceptable values
2.98
10.67
13.89
7.61
What would be the constraint code?
Kal_Lam
September 24, 2021, 4:20am
2
@vicks88 , you could do it as outlined in the post discussed previously:
You could do it as outlined in the image shared below:
In the survey tab of your xlsform:
[image]
Data entry screen as seen in Enketo: when a condition is not met
[image]
Data entry screen as seen in Enketo: when a condition is not met
[image]
Data entry screen as seen in Enketo: when a condition is not met
[image]
Data entry screen as seen in Enketo: when a condition is not met
[image]
Data entry screen as seen in Enketo: when a condition is not met
[image]
Data entry s…
1 Like
vicks88
September 24, 2021, 4:53am
3
This would be a complete series which needs to be restricted…
In decimal form… like i want to restrict value after the decimal part…
so 0.6 is acceptable but 0.61 isnt
so 2.6 is acceptable but 4.781 isnt
so 10.06 is acceptable but 12.81 isnt
SO there could be so many numbers after decimal which needs restriction …
In such a case what changes in the above REGEX code is required?
Kal_Lam
September 24, 2021, 5:01am
4
Maybe if this is the case, you could restrict your input by a regex code for the decimals as outlined in the support article:
For details, please feel free to go through our support article Restricting Text Responses With Regular Expressions .
In addition, you could also combine a regex code
and the constraint
together as outlined in the post discussed previously:
Hi @tanzilhuda ,
Backing up with what @bernieseville have said you could do the same as shown in the image below:
In the survey sheet of the xlsform:
[image]
Note: With this expression you will not be able to enter 00, hence integer between 01 to 99 are only accepted.
Reference xlsform:
Regex_Constraint.xlsx (10.0 KB)
GOOD DAY!
vicks88
September 24, 2021, 5:04am
5
Thanks a lot. I will try codes among these
1 Like