Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Requiring minimum and maximum digits

Community Beginner ,
Mar 23, 2018 Mar 23, 2018

I am putting together a Direct Deposit form for a new hire. I have figured out how to require the signer to enter digits and I put a maximum # of digits allowed. How can I require a minimum amount of digits?

902
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 23, 2018 Mar 23, 2018

Greetings!

Currently, there is no directive in field validation that limits the minimum number of digits like the maxlen directive does.

For Enterprise users, the best alternative is to use a regular expression.  Below is an example showing where the validation is, and how to expose/configure it.

regex.png

The actual regular expression will depend on how many characters you want to allow.

If you want to allow 4 digits, the expression would be:

^\d{4}$

The text tag directive would be:

:custom(regexp="^\d{4}$")

Qu

...
Translate
Adobe Employee ,
Mar 23, 2018 Mar 23, 2018
LATEST

Greetings!

Currently, there is no directive in field validation that limits the minimum number of digits like the maxlen directive does.

For Enterprise users, the best alternative is to use a regular expression.  Below is an example showing where the validation is, and how to expose/configure it.

regex.png

The actual regular expression will depend on how many characters you want to allow.

If you want to allow 4 digits, the expression would be:

^\d{4}$

The text tag directive would be:

:custom(regexp="^\d{4}$")

Quick breakdown:

^ - Identifies the beginning of the validation string. Prevents additional characters before the validation

\d - Identifies "digits" as acceptable characters in the validation

{4} - Indicates that four characters are expected. no more, no less

$ - Indicates the end of the string. Prevents additional characters after the validated string.

If you need a range, the expression can become complex (and confusing if you aren't accustomed to it).

If you can provide me with the constraints of your field, I'll try to work out what that expression would be.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines