Copy link to clipboard
Copied
Greetings,
I am trying to create a field for business to enter their FEIN number. The format is ##-#######.
I would like to create a text tag that requires 9 digits and the - to auto appear after the second number is entered. Is there a text tag to create this field.
I have tried the following codes:
{{#fein=*fein_es_:signer1:string(maxlen=10):format(number, “__-_______”):tooltip(“Format: xx-xxxxxxxxx”)}}
(maxlen 10 to include 9 digits plus the -)
{{#fein=*fein_es_:signer1:string(maxlen=10):format(number, “__,-,_______”):tooltip(“Format: xx-xxxxxxxxx”)}}
{{#fein=*fein_es_:signer1:string(char=num,maxlen=9)}}
Also, the maxlen limits the maximum amount of characters, is there a code for minimum or exact. I have tried minlen and len but they do not appear to work.
I'm afraid you need to make use of regular expressions to get this validation to work. Also note it's a validation which is different than formatting the value of a field.
With validation the form filler is forced to enter the value in the right format
try this as a tag
{{#fein=*fein_es_:signer1:custom(regexp="^[1-9]\\d?-\\d{7}$",msg="Format: xx-xxxxxxxxx")}}
I got the regex from here https://regexlib.com/REDetails.aspx?regexp_id=1990&AspxAutoDetectCookieSupport=1
In the text tag an addition
...Copy link to clipboard
Copied
I'm afraid you need to make use of regular expressions to get this validation to work. Also note it's a validation which is different than formatting the value of a field.
With validation the form filler is forced to enter the value in the right format
try this as a tag
{{#fein=*fein_es_:signer1:custom(regexp="^[1-9]\\d?-\\d{7}$",msg="Format: xx-xxxxxxxxx")}}
I got the regex from here https://regexlib.com/REDetails.aspx?regexp_id=1990&AspxAutoDetectCookieSupport=1
In the text tag an additional backslash has been added as per text tag reference guide;
In this syntax, the backslash char that is part of regexp constructs such as "\w", must always be escaped with a backslash., i.e., "\\w". And in order to search for a backslash, one must use \\\\. The string begin and end character double-quotes ("). If a quote is expected to occur within the data that the recipient enters, to provide a regexp validation string to match the quote they must be escaped as \" in the expression. A good reference for the syntax of regular expressions used by Adobe Sign can be found here.
For other users reading along, the above tag is a reference tag used in text tag shortning. it requires another target tag in the main document along these line {{$fein }}.
if not using text tag shortning the regula text tag would be {{*fein_es_:signer1:custom(regexp="^[1-9]\\d?-\\d{7}$",msg="Format: xx-xxxxxxxxx")}}
Copy link to clipboard
Copied
SimonESATS,
Your response answered my question perfectly. Thank you for the great insight and detailed explanation of the logic as well as the links to further expand my knowledge.
Greatly Appreciated,
Derek G.