Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

Input Mask Format

Last Updated: July 9, 2020

Knowledge Base → Forms → Form Building → Field Options → Input Mask Format

Use the Format field option to make sure users provide information in the right format. This can range from phone numbers to postal codes to serial numbers, and much more! Below, you will find information on how to customize the format of a Single Line Text field and Phone Number field.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

Please note: If the format option is left empty in a Single Line Text field, no extra validation will be applied. If the format field is left empty in a Phone Number field, the field will be validated to make sure a valid phone number has been entered.

Set a format with an input mask

— Premium Feature —

You may use the format option to require a specific format and simultaneously apply an input mask. An input mask helps your users enter the correct format, as shown below:
Format Input Mask

How to set a specific format

Determine the format that will be accepted by following the directions below.

  1. Go into a Single Line Text or Phone Number field's options.
  2. Type the preferred format in the Format box.
    Phone Number Alpha Format
  3. Save your form and preview it. When you put your cursor into the field, you will see the input mask appear. Users will only be able to enter characters that fit the saved format.
    Phone Number Alpha/Numeric Format

Accepted characters

The following characters can be used in the Format settings:

  • 9 - requires any numeric character
  • a - requires any alphabetic character
  • * - this is a wildcard; allows any character
  • ? - makes the following characters optional

Examples

  • Require a phone number in the (999)999-9999 format.

    (999)999-9999
  • Require a properly formatted social.

    999-99-9999
  • Require 5-6 numbers.

    99999?9
  • Require 4 alphabetic characters followed by any character.

    aaaa*

Regular expression validation

If the standard format options don't offer the flexibility that you need, use a regular expression to completely customize the format validation. Insert a regular expression beginning with ^ in the Format box. Please note that this will not add an input mask to your field. It will simply make sure the entered values match the format in your regular expression. If the entered values don't match the format, an error will appear after the Submit button is clicked.

Syntax

^[Expression body here]$

Please note that both the starting ^ and ending $ are required to treat the format as a regular expression. If you have questions about your regular expression, you can refer to many free regular expression devoted websites.

Examples

  • Require 5-10 alphanumeric characters.

    ^([a-zA-Z0-9]{5,10})$
  • Require 99.9999.9999 or 99.99999.9999 for the phone number format.

    ^([0-9]{2}.[0-9]{4,5}.[0-9]{4})$
  • Disallow certain characters. The following example will remove a, 1, ", and '.

    ^([^a1"']+)$
  • Only allow alphabetic characters.

    ^([a-zA-Z]+)$
  • Allow 1-3 characters country code and 2-3 characters area code to create an international phone number format, e.g. Switzerland (+41-83-333-3333)

    ^([0-9]{1,3}-[0-9]{2,3}-[0-9]{3}-[0-9]{4})$
  • Disallow a certain word. The following example will exclude the word mini.

    ^((?!mini).)*$
  • Set a format with an input mask
    • How to set a specific format
    • Accepted characters
    • Examples
  • Regular expression validation
    • Syntax
    • Examples
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

You do not have permission to view this form. Maybe you need to log in?

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews