Forums

checking value of text field

katzco 01 Apr, 2019
I have the following problem:
I use text fields in a form, valdiation is required and it can only be a number from 0 to 10.
I use equal to in action. When value is equal to 0 then go to next field, so far so good.
But howto if the number is not 0 but 1 or 2 or 3.
Can't use >= 1. So i'm a bit stuck here.
Any ideas
GreyHead 01 Apr, 2019
Hi Katzco,

You can use a Regular expression to check the entered value.

But maybe better to use a drop-down or a row of radio buttons to show a limited range of values.

Bob
katzco 01 Apr, 2019
Bob, thank you for the answer. I think i will use a drop down, but how does this regular expression look like. And where to put it. Would that be in the properties of the text field under the tab info?
healyhatman 01 Apr, 2019
No need to use a dropdown. On the design tab under Validation you want to tick Integer, set Mask to integer.
Under regular expression, put in ^(?:[0-9]|10)$
Since it's a number, I would under Advanced -> Extra Attributes put in type:tel

In the Setup tab for Validate Data action you can use

fieldname/regex[^(?:[0-9]|10)$]:Your field must be 0-10
katzco 01 Apr, 2019
thanks again. i try it
This topic is locked and no more replies can be posted.