Indeed, I want to limit certain value entry to 2 digits for certain, and 09 digits for telephone numbers. I followed the method, but I do not get convincing results. What is the problem? I attach the form with the parties concernedTest 7.xlsx (23.6 KB)
Regarding your first query:
Your xlsform wishes to restrict to 5 but you have stated 2 here. However you could do this as follows:
To restrict an entry to 5 digits:
To restrict an entry to 2 digits:
Regarding your second query:
Your xlsform wishes to restrict to 8 but you have stated 9 here. However you could do this as follows:
To restrict telephone number entry to 8 digits:
To restrict telephone number entry to 9 digits:
Please also see the images below for detailed instruction:
In the survey tab of your xlsform:
Note: Please see the changes that is within the red box as shown in the image above.
Data entry screen as seen in Enketo: When entered correctly
Data entry screen as seen in Enketo: When entered wrongly
Test 7.xlsx (10.1 KB)
You could also learn more on
regex by following our support article Restricting text responses with regular expressions.
Have a great day!
just adding to Kal_Lam: Be very careful
KoBoCollect android app and Enketo web forms behaves a bit differently with regex. KoBoCollect android app behaves as if you have used the anchors (^ $) around the regex (even if you have not used them), while Enketo requires the anchors as mandatory for an exact match. (see support article)
See also: Regex Problem in KoBoCollect
How can I restrict my response to exact 17 digit. It is an integer type. I have put the function like this:
But, it won’t allow me to input more than 9 digit. How can I solve it?
Integer type in KoBo is generally limited to 9 digits.
@tasfik_rukan, your question type should be
integer. It should then work. You will also need to change the