Help center

Set validation rules on form fields

Require business emails, check EU VAT numbers in VIES, check tax ID formats, limit numbers and dates, and test answers before you save the form.

Updated 4 min read

Validation rules stop applications with unusable answers, like a personal Gmail address or a VAT number in the wrong format, before they reach you. Open a field’s editor in Settings › Application form and set its rules in the Validation box. B2B Desk checks the rules in the applicant’s browser and again when the application is saved.

Rules by field type

Field type Rules you can set
Short answer Format, Minimum characters, Maximum characters
Paragraph Minimum characters, Maximum characters (up to 2,000)
Number Minimum, Maximum, Whole numbers only
Date Allowed dates: Any date, Today or earlier, Today or later
Email Only accept business email addresses

Some checks always run and need no setup: emails must be real email addresses, phone numbers must be 5 to 20 digits with or without a country code, websites must look like example.com, and dropdown or multiple-choice answers must be one of your choices.

Require a format

Choose Match a format, like ##-####### under Format, then write one format per line in Formats:

  • # is a digit
  • @ is a letter
  • * is either
  • Anything else must appear exactly as typed, like GB or -

Under the box, “Fits:” shows sample answers so you can check you wrote what you meant.

Number Format
UK VAT GB#########
German VAT DE#########
French VAT FR**#########
Dutch VAT NL#########B##
US EIN ##-#######
Canadian GST/HST number #########RT####

An answer passes when it matches any one of your formats, from start to finish. Spaces before and after are ignored. Letters you typed into a format, like GB, must match in the same case, so gb123456789 doesn’t fit GB#########. You can list up to 10 formats per field.

The other Format options are Numbers only (0–9) and Letters and numbers only.

Check EU VAT numbers in VIES

The Tax ID / VAT number field has Check EU VAT numbers in VIES, on by default. When an applicant submits, B2B Desk looks the number up in VIES, the European Commission’s VAT database, which is free and needs no setup.

What the applicant typed What happens
A number with an EU country prefix, like DE123456789 or IE 6388047V Looked up for that country, whatever the billing address
A number without a prefix that fits the VAT format of the billing country, like 123456789 in Germany Looked up for the billing country
Anything else, such as a US EIN, a UK or Swiss number, or a national tax number that isn’t a VAT number Accepted as typed, without a lookup

Greek numbers use the prefix EL, as VIES does, and Northern Ireland numbers use XI. Typing GR works too.

  • Registered: the application goes through. Reviewers see Registered in VIES with the name and address VIES has on file. See Approve an application.
  • Not registered: the applicant sees “This VAT number isn’t registered in the EU VAT database (VIES). Check the number and its country prefix.” and can fix it. Your own error message doesn’t replace this one.
  • VIES is down: each EU country runs its own part of VIES, and they go down from time to time. The application goes through anyway, and B2B Desk tries again in the background for about three and a half hours.

To turn the lookup off, untick Check EU VAT numbers in VIES in the field’s editor. The field’s summary shows “EU VAT numbers checked in VIES” while it’s on.

Accept business emails only

Tick Only accept business email addresses on the Email field to turn away addresses from 27 free email providers, including gmail.com, outlook.com, hotmail.com, yahoo.com, icloud.com, aol.com and proton.me. Applicants with one see “Use your business email address, not a personal one.”

Requiring a business email also makes duplicate detection and auto-approve rules more reliable, since both use the email’s domain.

Write your own error message

Once a field has a rule, an Error message box appears. Applicants see your message, up to 200 characters, instead of the default when an answer breaks a rule. Write what you want them to type, for example “Enter your VAT number, starting with GB.”

Your message never replaces the messages for a missing required answer, a wrong file type, a file that’s too large, or an answer that isn’t one of the choices.

Test an answer

Type a sample into Test an answer to see the result before you save. It shows “Passes” or “Doesn’t pass” with the exact message applicants would see. Nothing you type is saved. Testing works on Short answer, Paragraph, Number, Email, Phone number and Website link fields.

Default messages applicants see

Situation Message
Required field left empty “This field is required.”
Wrong format “Use the format” followed by a sample from your first format
Too short or too long “Enter at least 5 characters.” or “Use 64 characters or fewer.”
Number out of range “Enter 10 or more.” or “Enter 500 or less.”
Date outside the allowed range “Choose today or an earlier date.” or “Choose today or a later date.”
Invalid email “Enter a valid email address.”
Invalid phone “Enter a valid phone number.”
EU VAT number not in VIES “This VAT number isn’t registered in the EU VAT database (VIES). Check the number and its country prefix.”