Table of Contents:

TOC

Bricks Forge Pro Form Field Validation Rules: No Spaces Or Capital Letters

Introduction

Sometimes you want to limit what type of data your users can enter into a form field. Bricks Forge Pro Forms has a validation setting for each field. I prefer to use regular expressions (regex) to manage my fields data input requirements.

Here is the regex expression to look for capitals or spaces. Yea – it makes zero sense just looking at.

^[a-z0-9]+$

Explanation:

  • ^ Start of the string.
  • [a-z0-9] Allows only lowercase letters (a-z) and digits (0-9).
  • + Ensures at least one character is present.
  • $ End of the string.

Restrictions:

  • No spaces (Whitespace is not included in the allowed characters).
  • No uppercase letters (Only lowercase letters are allowed).
  • Allows numbers (If you want only letters, use ^[a-z]+$ instead).

Don’t have Bricks Forge Yet?

Get Bricks Forge Today!

How To Add Regex Validation To a Form Field

First, find the “Validation” parameter on your form field. Next, pick “Custom (Regex)” for the validation rule type. Finally, add your Regex expression into the box and set a validation message for failure.

Bricks Forge Pro Forms regex field validation settings

Live Validation Of Form Field User Input

I prefer live validation of form field inputs.

With Live validation, the user will receive a prompt underneath the form field that failed the validation check.

Do note that the validation runs as soon as the user navigates off of the field. So click out of the field to test the validation.

If you don’t use live validation, the error message will appear on form submit. You can try both options to see which works best for you.

Bricks Forge pro forms field live validation settings

Conclusion

There are only three main steps to get this working on your Pro Form. You have to get a working regex expression, you have to set the field up for validation, and you have to define live validation or submit validation. I prefer live validation because it validations along with the flow of the form and helps show the user the failed validation immediately.

Need Help With Bricks Builder?

John the owner of Bricks Coach and the lead instructor.
Book a consultation

Related Posts

Echo PHP Functions In Bricks Forge Pro Forms: Create Programmatic Default Values For Form Fields

February 13, 2025

Review Your Cart
0
Add Coupon Code
Subtotal