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

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 ?

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

···

On Tue, Dec 1, 2015 at 12:39 PM, sayali sayal...@gmail.com wrote:

Hi, I have applied validation code for field-

add question - contact number

type- Numeric

The validation code used by me is : regex(.,‘[1]{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 ?

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.


  1. 0-9 ↩︎

Thank you.

···

On Tue, Dec 1, 2015 at 7:43 PM, Tino Kreutzer tino.k...@kobotoolbox.org wrote:

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 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.

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.

On Tue, Dec 1, 2015 at 12:39 PM, sayali sayal...@gmail.com wrote:

Hi, I have applied validation code for field-

add question - contact number

type- Numeric

The validation code used by me is : regex(.,‘[1]{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 ?

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.


  1. 0-9 ↩︎