Creating phone number forms on Kobo

Good day

I am having a bit of a problem regarding building a form where only 10 digits can be accepted.

I have an open ended text form with the following script to limit the number of digits accepted:- regex(., ‘[0-9]’) and string-length(.) >= 10 and string-length(.) <= 10.

The script above does not seem to work. Please advise on how to correctly build this

Thulani

Hi Thulani,

We have had the same issue. The way I got around this was

  • create the phone number as a Text question
  • Under settings ->Appearance (Advanced) ->Select Numbers
···

On Monday, 7 March 2016 16:22:34 UTC+3, Thulani Gebuza wrote:

Good day

I am having a bit of a problem regarding building a form where only 10 digits can be accepted.

I have an open ended text form with the following script to limit the number of digits accepted:- regex(., ‘[0-9]’) and string-length(.) >= 10 and string-length(.) <= 10.

The script above does not seem to work. Please advise on how to correctly build this

Thulani

Hi Andy and Thulani,

Integer questions are limited to 9 digits, while text questions can take much longer entries. Here’s some more information on limits with number questions and how to store larger numeric strings: http://support.kobotoolbox.org/customer/en/portal/articles/2103790-limits-on-number-and-text-responses

Best,

Tino

···

On Tue, Apr 5, 2016 at 7:35 AM, Andy Simpson iraqresp...@tearfund.org wrote:

Hi Thulani,

We have had the same issue. The way I got around this was

  • create the phone number as a Text question
  • Under settings ->Appearance (Advanced) ->Select Numbers

On Monday, 7 March 2016 16:22:34 UTC+3, Thulani Gebuza wrote:

Good day

I am having a bit of a problem regarding building a form where only 10 digits can be accepted.

I have an open ended text form with the following script to limit the number of digits accepted:- regex(., ‘[0-9]’) and string-length(.) >= 10 and string-length(.) <= 10.

The script above does not seem to work. Please advise on how to correctly build this

Thulani

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 https://groups.google.com/group/kobo-users.

For more options, visit https://groups.google.com/d/optout.

1 Like

Hi Thulani,
you can use this script:
regex(., ‘[1][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$’)
I’ve used it and works fine for me.

···

On Monday, March 7, 2016 at 5:52:34 PM UTC+4:30, Thulani Gebuza wrote:

Good day

I am having a bit of a problem regarding building a form where only 10 digits can be accepted.

I have an open ended text form with the following script to limit the number of digits accepted:- regex(., ‘[0-9]’) and string-length(.) >= 10 and string-length(.) <= 10.

The script above does not seem to work. Please advise on how to correctly build this

Thulani


  1. 0-0 ↩︎

1 Like