Validation error on GeoODK collect for restricting numeric digit entry to 10

95 views
Skip to first unread message

sayali

unread,
Dec 1, 2015, 5:39:24 AM12/1/15
to Kobo Users
Hi, I have applied validation code for field-

add question - contact number
type- Numeric

The validation code used by me is : regex(.,'^[0-9]{10}$')

When I deploy the form, on the ODK collect, only 9 digits can be entered. It does not allow entry of 10th digit.

Using the same regular expression as validation to restrict to 6 digits is possible.
What can be another validation code that can be used ?

Tino Kreutzer

unread,
Dec 1, 2015, 9:14:06 AM12/1/15
to kobo-...@googlegroups.com
Hi Sayali,
The 'number' / 'integer' question type is restricted to no more than 9 digits. To work around this you can create a text question, which allows any number of characters. Your regex already restricts your input to numbers of course. Finally, to show the number keyboard on Android devices even when using a text question just set the appearance of the question to 'numbers'. 

Best,
Tino

--
You received this message because you are subscribed to the Google Groups "Kobo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kobo-users+...@googlegroups.com.
To post to this group, send email to kobo-...@googlegroups.com.
Visit this group at http://groups.google.com/group/kobo-users.
For more options, visit https://groups.google.com/d/optout.

sayali goregaonkar

unread,
Dec 2, 2015, 2:27:07 AM12/2/15
to kobo-...@googlegroups.com
Thank you.

--
You received this message because you are subscribed to a topic in the Google Groups "Kobo Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kobo-users/Y8C-ZRNmlM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kobo-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages