Super Forms
  • Drag & Drop Form Builder for WordPress
  • Quick start
    • Installation
    • Registration
    • Starting your 15 day trial
    • Purchasing a license
    • Activating a license
    • First time setup
    • Secure file uploads
    • Creating a form
    • Adding form elements
    • Editing elements
    • Publishing your form
    • FAQ
  • Account
    • Dashboard
      • Your Invoices
      • Billing details
      • Your Licenses
      • E-mail Notification
      • Password reset
      • Cancel subscription
  • Common problems
    • Common problems
      • Email delivery problems
        • Why is my form not sending emails?
        • Why are emails going into spam folder/inbox?
      • File upload problems
      • Session expired
      • reCaptcha Troubleshooting – Fix “Not Loading” & Verification Errors
  • Elements
    • Layout elements
      • Column/Grid
      • Multi-part / step
    • Form elements
      • Calculator
      • Signature
      • File upload
      • Datepicker
      • Variable field
      • Dropdown
      • Text field
      • Autosuggest
      • Keywords
      • Radio button
      • Keyword Field
      • Button
      • Audio Recording (microphone)
    • HTML elements
      • Heading
      • HTML (raw)
      • Image
      • TinyMCE
      • Divider
      • Spacer
      • PDF page break
      • Google map element WordPress form
  • Features
    • Basic
      • Confirmations emails
      • Save Form Progression (continue later)
      • Build In Translation System
      • Populate form
      • Popups
      • Import & Export
      • Hide form after submitting
      • Hide or lock out user from your forms
      • Validation
    • Advanced
      • WordPress form with Google sheets dropdown
      • Custom registration form for WordPress
      • Custom login form for WordPress
      • Custom lost password form for WordPress
      • Update current logged in user
      • Secrets
      • Prevent duplicate entries
      • Lock & hide form
      • Password protect
      • Conditional Logic
      • Tags system
      • Address lookup/auto complete
      • Analytics Tracking
      • Conversion Tracking
      • Distance & Duration Calculation
      • If statements
      • Foreach loops
      • E-mail Reminders
      • Variable Fields
      • Form templates - Include elements into other forms - WordPress
      • Transferring data from one form to another
    • Integrations
      • PDF Generator
      • Listings
      • WooCommerce Checkout
        • Fixed price checkout
        • Dynamic price checkout
        • Variable product checkout (variations)
        • Replacing the "Add to cart" on a product page with a form
        • Hiding product from shop and order via custom form
      • PayPal
      • MailChimp
      • Mailster
      • Zapier
      • Stripe (BETA)
      • WooCommerce Instant Order (in progress)
  • Tutorials
    • WordPress Form to Google Sheet Integration
    • GDPR Consent / Terms agreement
    • How to update the plugin
    • Sending emails to specific department for WordPress contact forms
  • Example Forms for WordPress
    • Booking 24 hours ahead of time
  • Developers
    • Code Examples
      • Lookup City by Zipcode for your WordPress form
      • Audio Recording Field
      • Custom API Phone Number Validation for Your WordPress Form
      • Updating WordPress user meta data after login
      • Automatically redirecting to next step after displaying text or a progress bar
      • Dropdown with groups (categories)
      • Prevent form submission based on entered field values
      • Track form submissions with GTM (Google Tag Manager)
      • Tracking Multi-part steps with Google Analytics
      • Tracking Multi-part steps with GTM data layer (dataLayer.push)
      • Track form submissions with third party
      • Compare input field value with database value
      • Insert form data into a custom database table
      • Delete database row after contact entry is deleted in WordPress
      • Limited date availability (slots) for your WordPress booking form
      • Send submitted form data to another site
      • Exclude empty fields from emails
      • Execute custom JS when a column becomes conditionally visible
      • Toolset Plugin: Update comma separated string to Array for meta data saved via Front-end Posting
      • Toolset Plugin: Update file ID to file URL for meta data saved via Front-end Posting
      • Delete uploaded files after email has been send
      • Increase Cookie lifetime for client data such as [Form Progression]
      • Altering cookie secure and httponly parameters
      • Define fake cronjob to clear old client data if cronjob is disabled on your server
      • Define page language attribute based on page ID or URL
      • Define custom headers when doing a POST request
      • Change checkbox/radio layout to vertical on mobile devices
      • Show remaining available form submission allowed
      • Global fields / elements
      • Trim values of fields
      • Re-sending E-mails after editing entries via Listings for WordPress
      • Combine multiple field values into one column on Contact Entries page
      • Altering the attachments for E-mails via PHP code for WordPress
      • Generate dynamic columns with dates based on user selected date from Datepicker element
      • Hide `eye` icon from Listings row based on user role
      • Variable product checkout based on variation SKU
    • Data storage
    • BETA version
  • Changelog
  • Support
Powered by GitBook
On this page
  • Letters only
  • Required Field (not empty)
  • E-mail address
  • Phone number
  • Numeric
  • Float
  • Website URL
  • IBAN
  • Custom Regex
  1. Features
  2. Basic

Validation

The Validation option gives you the ability to quickly add a specific validation to any of your fields. This will decrease the risk of a user making mistakes or typos while filling out the form.

Below you can find the available validation methods:

Letters only

Only allow input field to contain letters, and nothing else

^[a-zA-Z]+$

Required Field (not empty)

This is the most used validation method, it will simply check if the field was entered or not. This allows you to make a field a so called Required field*.

E-mail address

This validation method checks if the entered email address was a possible valid

The regex used for this validation is:

^([\w-\.]+@([\w-]+\.)+[\w-]{2,63})?$

Phone number

Validations phone numbers with a minimum of 10 characters in length and only allows numbers, spaces, -, +

The regex used for this validation is:

^((\+)?[1-9]{1,2})?([-\s\.])?((\(\d{1,4}\))|\d{1,4})(([-\s\.])?[0-9]{1,12}){1,2}$

Numeric

This validation checks if the entered value contains numbers only and no other characters.

The regex used for this validation is:

^\d+$

Float

This validation method can be used whenever you require to validate the user input to be a float value. A float value never contains a comma, and only contains numbers and a dot (.).

The regex used for this validation is:

^[+-]?\d+(\.\d+)?$

Website URL

This validation method is used whenever you require the user to enter a valid URL address.

The regex used for this validation is:

^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$

IBAN

Whenever you are asking for an IBAN number you can use this validation method to make sure the entered IBAN is a valid number.

Custom Regex

If you require a specific validation this option allows you to use a custom regular expression on the value entered by the user. If no match was found based on the entered value the Error Message will be displayed to the user.

Some example regular expressions that you might like to use are:

match password that is at least 8 characters long, contains a lower case and upper case letter, contains at least one number and at least a special character/symbol.

^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z])(?=.*[$&+,:;=?@#|\/\\[\]{}'"<>.^*()%!-]).{8,}$

match username

^[a-z0-9_-]{3,16}$

match any ip address

^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$

match credit card numbers

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35d{3})d{11})$

match email address

^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$

match email address except specific domains

^(?!.*@(spamgourmet|mailinator))[\w-.+]+@([\w-]+.)+[\w-]{2,63}$

select integers only

^[0-9 -()+]+$

match number in range 0-255

^([01][0-9][0-9]|2[0-4][0-9]|25[0-5])$

match number in range 0-999

^([0-9]|[1-9][0-9]|[1-9][0-9][0-9])$

match ints and floats/decimals

^[-+]?([0-9]*.[0-9]+|[0-9]+)$

Match Any number from 1 to 50 inclusive

^(^[1-9]{1}$|^[1-4]{1}[0-9]{1}$|^50$)$

match elements that could contain a phone number

^[0-9-()+]{3,20}$

MatchDate (e.g. 21/3/2006)

^(d{1,2}/d{1,2}/d{4})$

match date in format MM/DD/YYYY

^(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[- /.](19|20)dd$

match date in format DD/MM/YYYY

^(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)dd$

match a url string (Fixes spaces and querystrings)

^(http(s)?:\/\/)?(www\.)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$

match domain name (with HTTP)

(.*?)[^w{3}.]([a-zA-Z0-9]([a-zA-Z0-9-]{0,65}[a-zA-Z0-9])?.)+[a-zA-Z]{2,6}$

match domain name (www. only)

[^w{3}.]([a-zA-Z0-9]([a-zA-Z0-9-]{0,65}[a-zA-Z0-9])?.)+[a-zA-Z]{2,6}$

match domain name (alternative)

(.*?).(com|net|org|info|coop|int|com.au|co.uk|org.uk|ac.uk|)$

match sub domains: www, dev, int, stage, int.travel, stage.travel

(http://|https://)?(www.|dev.)?(int.|stage.)?(travel.)?(.*)+?$

Match jpg, gif or png image

([^s]+(?=.(jpg|gif|png)).2)$

match all images

<img .+?src="(.*?)".+?/>$

match just .png images

<img .+?src="(.*?.png)".+?/>$

match RGB (color) string

^rgb((d+),s*(d+),s*(d+))$

match hex (color) string

^#?([a-f0-9]{6}|[a-f0-9]{3})$

Match Valid hexadecimal colour code

(#?([A-Fa-f0-9]){3}(([A-Fa-f0-9]){3})?)$

match a HTML tag (v1)

^< ([a-z]+)([^<]+)*(?:>(.*)< /1>|s+/>)$

match HTML Tags (v2)

(< (/?[^>]+)>)$

match /product/123456789

(/product/)?+[0-9]+$

Match Letters, numbers and hyphens

([A-Za-z0-9-]+)$

PreviousHide or lock out user from your formsNextAdvanced

Last updated 1 year ago