When you create a custom text field to request information from your signing party, you can set up a simple validation process using regular expressions (regex) to make sure the data your signing party enters conforms to a specific data format.
Example: IBAN number
Let's say you’re asking a customer for their bank account’s IBAN number. This short tutorial shows how you can:
- tell the signing party how to enter it (with a tool tip)
- require that they enter a valid data format before they can sign the document
We’ll use the following sample Swedish IBAN number:
SE4550000000058398257466
Using regular expressions (regex)
If you're not familiar with regular expressions, it’s easy to find pre-built regular expressions for many common situations. A Google search for "Swedish IBAN regex" finds the following regex, which you will use in the tutorial below:
SE\d{2}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{4}|SE\d{22}
In layman’s terms, this means the expected text input:
- must start with "SE"
- must be followed by 22 numbers
- can include spaces, but no special characters
The validation for the sample IBAN would work as follows:
- Valid: SE35 5000 0000 0549 1000 0003
- Valid: SE3550000000054910000003
- Fail: SE35-5000-0000-0549-1000-0003
- Fail: SE35500000000549100000 (not enough numbers)
IMPORTANT: Regex is a very powerful tool, but to avoid serious problems, it's critical that you properly validate and test any regular expression before using it.
Tutorial: IBAN validation
- Start by placing a custom field in your document and naming it “IBAN”.
- In the text field dialog, click More settings:
- Under Validation click Add (only available for custom fields). The Field validation dialog opens:
- Select Custom from the menu at the top of the dialog.
-
In the Regex Pattern field, paste this regex:
SE\d{2}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{4}[ ]\d{4}|SE\d{22}
Before you can save the regex, you need to verify it by providing a valid input example. - In the Provide a valid example to verify your regex field, paste the sample IBAN:
SE4550000000058398257466
The field turns green to confirm that the regex will work for this situation: -
In the Tooltip message field, enter a clear instruction about the required data format. For example:
"Please enter your Swedish IBAN number in the following format: SE4550000000012345678999" - Click Save.
Comments
0 comments
Please sign in to leave a comment.