Issues with digits

Hello,
i want my input field to only accept 5 digits and the code is

However, its working but ungortunately it is not recognizing leading zeros
as digits
i.e 00001 is not valid but yet contains 5 digits
how can make leading zeros be recognized.

··· -- Gichure Paul Regards.

haven't tested this, but try 'regex(,[0-9]{5})'

··· On Mon, Aug 1, 2011 at 06:34, Gichure wrote: > Hello, > i want my input field to only accept 5 digits and the code is > relevant="(/data/similar=0)" constraint="regex(., '^\d\d\d\d\d$')" > jr:constraintMsg="This isn't a valid EA code.Enter 5 digits only"/> > However, its working but ungortunately it is not recognizing leading zeros > as digits > i.e 00001 is not valid but yet contains 5 digits > how can make leading zeros be recognized. > > -- > Gichure Paul > Regards. > > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

good catch, andrew.

if you are using collect 1.1.7, you can set the type to string and add
an appearance tag like so . that will bring up the number keyboard.

yaw

··· On Mon, Aug 1, 2011 at 06:43, Andrew Marder wrote: > Hi Gichure, > > I believe changing the type from "int" to "string" will allow for > leading zeros. The downside to this approach is that the on screen > keyboard will show letters rather than numbers. I recall some mentions > on this list about specifying which keyboard to use, but I don't > remember the syntax. > > Andrew > > On Mon, Aug 1, 2011 at 9:34 AM, Gichure wrote: >> Hello, >> i want my input field to only accept 5 digits and the code is >> > relevant="(/data/similar=0)" constraint="regex(., '^\d\d\d\d\d$')" >> jr:constraintMsg="This isn't a valid EA code.Enter 5 digits only"/> >> However, its working but ungortunately it is not recognizing leading zeros >> as digits >> i.e 00001 is not valid but yet contains 5 digits >> how can make leading zeros be recognized. >> >> -- >> Gichure Paul >> Regards. >> >> >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en >> > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

Hi Gichure,

I believe changing the type from "int" to "string" will allow for
leading zeros. The downside to this approach is that the on screen
keyboard will show letters rather than numbers. I recall some mentions
on this list about specifying which keyboard to use, but I don't
remember the syntax.

Andrew

··· On Mon, Aug 1, 2011 at 9:34 AM, Gichure wrote: > Hello, > i want my input field to only accept 5 digits and the code is > relevant="(/data/similar=0)" constraint="regex(., '^\d\d\d\d\d$')" > jr:constraintMsg="This isn't a valid EA code.Enter 5 digits only"/> > However, its working but ungortunately it is not recognizing leading zeros > as digits > i.e 00001 is not valid but yet contains 5 digits > how can make leading zeros be recognized. > > -- > Gichure Paul > Regards. > > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

have done it before and had issues with making it exact 5 digits. i could
only manage to make it read 5 or more digits. help on how to get strictly 5
digits only

··· On Mon, Aug 1, 2011 at 4:43 PM, Andrew Marder wrote:

Hi Gichure,

I believe changing the type from "int" to "string" will allow for
leading zeros. The downside to this approach is that the on screen
keyboard will show letters rather than numbers. I recall some mentions
on this list about specifying which keyboard to use, but I don't
remember the syntax.

Andrew

On Mon, Aug 1, 2011 at 9:34 AM, Gichure gichurepaul@gmail.com wrote:

Hello,
i want my input field to only accept 5 digits and the code is

However, its working but ungortunately it is not recognizing leading
zeros
as digits
i.e 00001 is not valid but yet contains 5 digits
how can make leading zeros be recognized.

--
Gichure Paul
Regards.

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Gichure Paul
Regards.

will match exactly five digits.

··· On Mon, Aug 1, 2011 at 06:52, Gichure wrote: > have done it before and had issues with making it exact 5 digits. i could > only manage to make it read 5 or more digits. help on how to get strictly 5 > digits only > > On Mon, Aug 1, 2011 at 4:43 PM, Andrew Marder wrote: >> >> Hi Gichure, >> >> I believe changing the type from "int" to "string" will allow for >> leading zeros. The downside to this approach is that the on screen >> keyboard will show letters rather than numbers. I recall some mentions >> on this list about specifying which keyboard to use, but I don't >> remember the syntax. >> >> Andrew >> >> On Mon, Aug 1, 2011 at 9:34 AM, Gichure wrote: >> > Hello, >> > i want my input field to only accept 5 digits and the code is >> > > > relevant="(/data/similar=0)" constraint="regex(., '^\d\d\d\d\d$')" >> > jr:constraintMsg="This isn't a valid EA code.Enter 5 digits only"/> >> > However, its working but ungortunately it is not recognizing leading >> > zeros >> > as digits >> > i.e 00001 is not valid but yet contains 5 digits >> > how can make leading zeros be recognized. >> > >> > -- >> > Gichure Paul >> > Regards. >> > >> > >> > -- >> > Post: opendatakit@googlegroups.com >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> > Options: http://groups.google.com/group/opendatakit?hl=en >> > >> >> -- >> Post: opendatakit@googlegroups.com >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com >> Options: http://groups.google.com/group/opendatakit?hl=en > > > > -- > Gichure Paul > Regards. > > > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en >

Sir,
What if i want digit length like between 2 to 5... in your expression
regex(., '^[0-9]{5}$')

I have tried this - regex(., '^[0-9]{2-5}$') but ODK collect crashed every time..

My Requirement is to allow only alphabets A-Z a-z and total digit must be between 2 to 5... as i m gonna use this query for NAME field...

help me plz to solve it out.

··· On Tuesday, August 2, 2011 8:54:47 AM UTC+5:30, Yaw Anokwa wrote: > constraint="regex(., '^[0-9]{5}$')" jr:constraintMsg="five digits > only"/> > > will match exactly five digits. > > > On Mon, Aug 1, 2011 at 06:52, Gichure wrote: > > have done it before and had issues with making it exact 5 digits. i could > > only manage to make it read 5 or more digits. help on how to get strictly 5 > > digits only > > > > On Mon, Aug 1, 2011 at 4:43 PM, Andrew Marder wrote: > >> > >> Hi Gichure, > >> > >> I believe changing the type from "int" to "string" will allow for > >> leading zeros. The downside to this approach is that the on screen > >> keyboard will show letters rather than numbers. I recall some mentions > >> on this list about specifying which keyboard to use, but I don't > >> remember the syntax. > >> > >> Andrew > >> > >> On Mon, Aug 1, 2011 at 9:34 AM, Gichure wrote: > >> > Hello, > >> > i want my input field to only accept 5 digits and the code is > >> > >> > relevant="(/data/similar=0)" constraint="regex(., '^\d\d\d\d\d$')" > >> > jr:constraintMsg="This isn't a valid EA code.Enter 5 digits only"/> > >> > However, its working but ungortunately it is not recognizing leading > >> > zeros > >> > as digits > >> > i.e 00001 is not valid but yet contains 5 digits > >> > how can make leading zeros be recognized. > >> > > >> > -- > >> > Gichure Paul > >> > Regards. > >> > > >> > > >> > -- > >> > Post: opendatakit@googlegroups.com > >> > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > >> > Options: http://groups.google.com/group/opendatakit?hl=en > >> > > >> > >> -- > >> Post: opendatakit@googlegroups.com > >> Unsubscribe: opendatakit+unsubscribe@googlegroups.com > >> Options: http://groups.google.com/group/opendatakit?hl=en > > > > > > > > -- > > Gichure Paul > > Regards. > > > > > > -- > > Post: opendatakit@googlegroups.com > > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > > Options: http://groups.google.com/group/opendatakit?hl=en > >

That regex looks fine to me, so something else might be going on. File
a bug report at https://code.google.com/p/opendatakit/issues with the
make/model of the device you are using and version of Collect you have
installed.

Attach a one or two question form that shows this problem and attach a
stack trace (see
https://code.google.com/p/opendatakit/wiki/CollectTroubleshooting) so
the core team knows exactly what the error is.

Yaw

··· -- Need ODK services? Go to http://nafundi.com for form design, data cleaning, custom reporting, and software development for ODK.

On Fri, Jul 19, 2013 at 5:54 AM, palaksdarji@gmail.com wrote:

Sir,
What if i want digit length like between 2 to 5... in your expression
regex(., '^[0-9]{5}$')

I have tried this - regex(., '^[0-9]{2-5}$') but ODK collect crashed every time..

My Requirement is to allow only alphabets A-Z a-z and total digit must be between 2 to 5... as i m gonna use this query for NAME field...

help me plz to solve it out.

On Tuesday, August 2, 2011 8:54:47 AM UTC+5:30, Yaw Anokwa wrote:

will match exactly five digits.

On Mon, Aug 1, 2011 at 06:52, Gichure gichurepaul@gmail.com wrote:

have done it before and had issues with making it exact 5 digits. i could
only manage to make it read 5 or more digits. help on how to get strictly 5
digits only

On Mon, Aug 1, 2011 at 4:43 PM, Andrew Marder andrew.ei.marder@gmail.com wrote:

Hi Gichure,

I believe changing the type from "int" to "string" will allow for
leading zeros. The downside to this approach is that the on screen
keyboard will show letters rather than numbers. I recall some mentions
on this list about specifying which keyboard to use, but I don't
remember the syntax.

Andrew

On Mon, Aug 1, 2011 at 9:34 AM, Gichure gichurepaul@gmail.com wrote:

Hello,
i want my input field to only accept 5 digits and the code is

However, its working but ungortunately it is not recognizing leading
zeros
as digits
i.e 00001 is not valid but yet contains 5 digits
how can make leading zeros be recognized.

--
Gichure Paul
Regards.

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Gichure Paul
Regards.

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.