how to apply validator for text field to allow only integer number
Issue #207
resolved
I added number field and validator it is working fine but after creation of the ticket it is showing "," in integer field, so I want to add text field and validate with regex , please suggest me on the same.
how to apply validator for text field to allow only integer number
Comments (3)
-
repo owner -
repo owner You can validate whether a text field contains an integer using "Boolean validator with math, date-time or text-string terms" the following boolean expression:
matches(%{nnnnn}, "\\s*[-+]\\s*?\\d+\\s*")
replacing nnnnn with the corresponding field code.
-
repo owner - changed status to resolved
- Log in to comment
You don't need to use text field to validate that a number field contains an integer. To do it you should use "Boolean validator with math, date-time or text-string terms" wit the following boolean expression:
If you want to remove the fractional part of a number field, you can use "Mathematical and date-time expression calculator" with the following formula:
replacing nnnnn with the corresponding field code.