Limit number of characters allowed in entry (constraint)

Hi there,

I am sure this is fairly simple but it is not working for me.

I have a question that asks the registration number of the business being
surveyed - The registration number is always 11 characters.

In order to enable it to only accept answers of this length I put

constraint=" . >=9999999999 and .<999999999999"

but no matter what is entered it tells me that the answer is not allowed.

I also have this same issue with a constraint applied for a month entry
where I want to obviously limit it to under 12 months as I´m giving them
the option to say that they have worked for x years and y months.

constraint=".> 0 and . <13"

Could someone assist in correcting the code here?

Help much appreciated.

Integers can't be bigger than 2,147,483,648. Instead, make a text
prompt with an appearance attribute of "numbers" and a constraint of
"regex(., ^[0-9]{11}')".
https://code.google.com/p/opendatakit/issues/detail?id=546 has an example.

As to the month constraint, not sure what is going on. Maybe make sure
you are using an integer prompt (and not date). If you are using the
date prompt, I don't know offhand how to do that constraint. Maybe
someone else from the community can look that up.

Yaw

··· -- Need ODK services? http://nafundi.com provides form design, server setup, professional support, and software development for ODK.

On Thu, Nov 28, 2013 at 2:53 PM, sayling@poverty-action.org wrote:

Hi there,

I am sure this is fairly simple but it is not working for me.

I have a question that asks the registration number of the business being
surveyed - The registration number is always 11 characters.

In order to enable it to only accept answers of this length I put

constraint=" . >=9999999999 and .<999999999999"

but no matter what is entered it tells me that the answer is not allowed.

I also have this same issue with a constraint applied for a month entry
where I want to obviously limit it to under 12 months as I´m giving them the
option to say that they have worked for x years and y months.

constraint=".> 0 and . <13"

Could someone assist in correcting the code here?

Help much appreciated.

--

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.