Defining Input Mask for Answers in ODK Collect

Dear Fellows,

Is it possible to define an input mask for text or numeric fields. I need to collect some data which must be on a format like xxxxx-xxxxxxx-x while each x should be a numeric character.

Please help.

Thanks in anticipation.

Use a regex as a constraint. This is untested, but probably works...

[1]{5}-[0-9]{7}-[0-9]{1}$

Be sure to use a string with appearance=numbers or bad things might happen.

Yaw

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

On Tue, Jul 15, 2014 at 11:16 AM, plannerqadeer@gmail.com wrote:

Dear Fellows,

Is it possible to define an input mask for text or numeric fields. I need to collect some data which must be on a format like xxxxx-xxxxxxx-x while each x should be a numeric character.

Please help.

Thanks in anticipation.

--

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/d/optout.


  1. 0-9 โ†ฉ๏ธŽ

1 Like

Thank you so much Anokwa. It has worked. I used the following as constraint in bind nodeset:

constraint="regex(., '^[0-9]{5}-[0-9]{7}-[0-9]{1}$')"

Once again thank you for help.

Is there any mechanism to have the dashes "-" already in placed while entering data. I mean that user should not require putting them??

No. It has to be entered by the user. Alternative is to have multiple
input boxes for numbers between the dashes.

Yaw

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

On Wed, Aug 6, 2014 at 5:01 AM, plannerqadeer@gmail.com wrote:

Is there any mechanism to have the dashes "-" already in placed while entering data. I mean that user should not require putting them??

--

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/d/optout.

Dear Yaw,

Thank you for clarification. Can we arrange input boxes such that they
appear like BOX1 - *BOX 2 * - *BOX 3 *

ยทยทยท On Wed, Aug 6, 2014 at 6:38 PM, Yaw Anokwa wrote:

No. It has to be entered by the user. Alternative is to have multiple
input boxes for numbers between the dashes.

Yaw

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

On Wed, Aug 6, 2014 at 5:01 AM, plannerqadeer@gmail.com wrote:

Is there any mechanism to have the dashes "-" already in placed while
entering data. I mean that user should not require putting them??

--

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/d/optout.

No.

ยทยทยท On Wednesday, August 6, 2014, Syed Muhammad Qadeer wrote:

Dear Yaw,

Thank you for clarification. Can we arrange input boxes such that they
appear like BOX1 - *BOX 2 * - *BOX 3 *

On Wed, Aug 6, 2014 at 6:38 PM, Yaw Anokwa <yanokwa@nafundi.com <javascript:_e(%7B%7D,'cvml','yanokwa@nafundi.com');>> wrote:

No. It has to be entered by the user. Alternative is to have multiple
input boxes for numbers between the dashes.

Yaw

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

On Wed, Aug 6, 2014 at 5:01 AM, <plannerqadeer@gmail.com <javascript:_e(%7B%7D,'cvml','plannerqadeer@gmail.com');>> wrote:

Is there any mechanism to have the dashes "-" already in placed while
entering data. I mean that user should not require putting them??

--

Post: opendatakit@googlegroups.com
<javascript:_e(%7B%7D,'cvml','opendatakit@googlegroups.com');>
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
<javascript:_e(%7B%7D,'cvml','opendatakit%2Bunsubscribe@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
<javascript:_e(%7B%7D,'cvml','opendatakit%2Bunsubscribe@googlegroups.com');>
.
For more options, visit https://groups.google.com/d/optout.

Hi Anokwa and others,
I am using mask like the one youhave discussed: constraint="regex(., '^[0-9]{5}-[0-9]{7}-[0-9]{1}$')".

But the smart phone does not display hypens only numbers and a key with a dot and hypen together .- (not separately.)

Thanks in advance for your kind support.
Mario
PS: Still need to introduce myself to the Forum.