Skip to content

Validation ​

NXForms checks answers twice: in the visitor's browser, so mistakes show before anything is sent, and on your server, so a tampered request can't skip a check.

Built-in checks ​

  • Required fields must be answered.
  • Email and URL fields must hold a valid address.
  • Number and Slider fields respect their minimum and maximum.
  • Choice fields only accept the options you listed.

When a submission fails, a "There is a problem" summary appears above the form and links to each field with an error. Each error shows next to its field and is announced by screen readers.

Validation rules ​

For Text, Email, Phone, URL, Number, Textarea and Password fields you can add a rule:

  1. Select the field and open Validation.
  2. Tick Advanced validation and choose a Rule.
  3. Optionally write an Error message; otherwise the visitor sees "Please fill in this field correctly."
The Validation section of the Email address field with Advanced validation ticked and a Rule list
RuleAccepts
Letters only, Letters and spaces, Letters and digitsPlain letters (a–z), optionally with spaces or digits
… (incl. accents)The same, with accented letters such as é or ü
Digits only, Digits and spacesNumbers written as digits
Minimum length, Maximum lengthAnswers with at least or at most a number of characters
Email address, Email with DNS checkA valid email address; the DNS check also asks whether its domain can receive mail
URL, IP addressA web address or an IP address
Phone number, US ZIP codeA phone number or a US ZIP code
Must match another fieldThe same answer as another field, such as a repeated email address
Regular expression, Custom character setAnswers matching your own pattern or set of allowed characters
Credit card number, IBAN (bank account)A number that passes the card or IBAN checksum
Restricted wordsAnswers without the words you list
Passphrase matchA passphrase you set, for example to protect a form for a group
Multiple rules combinedSeveral rules at once

The error message also applies to the built-in checks, for every field type that collects an answer.