I have a form in which I want users to be guided by certain validation
rules but I also have some "special" cases that I want to allow.
As an example, for an age question, I want to validate age to be between 18
and 100 years, but also want the ability to enter something like -65 for
non response or -77 for dont know.
Is this possible or is there another work around?
That will give you the output of 18-100, -77, or -65 from the hidden value
"age_output", but will give your users the ability to enter either a valid
age, check a box that denotes that the age is unknown, or skip the question
without needing to know the special flags.
-Clayton
···
On Tue, Oct 4, 2016 at 11:27 AM, Sam Phiri wrote:
Hi All,
I have a form in which I want users to be guided by certain validation
rules but I also have some "special" cases that I want to allow.
As an example, for an age question, I want to validate age to be between
18 and 100 years, but also want the ability to enter something like -65 for
non response or -77 for dont know.
Is this possible or is there another work around?
That will give you the output of 18-100, -77, or -65 from the hidden value
"age_output", but will give your users the ability to enter either a valid
age, check a box that denotes that the age is unknown, or skip the question
without needing to know the special flags.
I have a form in which I want users to be guided by certain validation
rules but I also have some "special" cases that I want to allow.
As an example, for an age question, I want to validate age to be between
18 and 100 years, but also want the ability to enter something like -65 for
non response or -77 for dont know.
Is this possible or is there another work around?
An if statement in the validation seems to work also.Something like if((.
= 18 and . <= 100), true(), if((. = -65), true(), if((. = -77), true(),
false())))
Question: Does having a number of these (100 or more) affect the load speed
of the form?
Kind regards,
···
On 4 October 2016 at 17:48, Clayton Sims wrote:
whoops, wrote that expression a bit fast. I meant:
That will give you the output of 18-100, -77, or -65 from the hidden
value "age_output", but will give your users the ability to enter either a
valid age, check a box that denotes that the age is unknown, or skip the
question without needing to know the special flags.
I have a form in which I want users to be guided by certain validation
rules but I also have some "special" cases that I want to allow.
As an example, for an age question, I want to validate age to be between
18 and 100 years, but also want the ability to enter something like -65 for
non response or -77 for dont know.
Is this possible or is there another work around?
Encoding in the validation condition definitely works as well, yes.
Including validation conditions will have a marginal impact on the speed of
loading the form. At that scale I would not anticipate a meaningful hit to
performance.
-Clayton
···
On Tue, Oct 4, 2016 at 12:17 PM, Sam Phiri wrote:
Thanks Clayton
An if statement in the validation seems to work also.Something like if((.
= 18 and . <= 100), true(), if((. = -65), true(), if((. = -77), true(),
false())))
Question: Does having a number of these (100 or more) affect the load
speed of the form?
Kind regards,
On 4 October 2016 at 17:48, Clayton Sims csims@dimagi.com wrote:
whoops, wrote that expression a bit fast. I meant:
That will give you the output of 18-100, -77, or -65 from the hidden
value "age_output", but will give your users the ability to enter either a
valid age, check a box that denotes that the age is unknown, or skip the
question without needing to know the special flags.
I have a form in which I want users to be guided by certain validation
rules but I also have some "special" cases that I want to allow.
As an example, for an age question, I want to validate age to be
between 18 and 100 years, but also want the ability to enter something like
-65 for non response or -77 for dont know.
Is this possible or is there another work around?