How to Check for US Social Security Numbers in Shack Forms

How to Validate US Social Security Number Field in Shack Forms

One of our customers asked how to validate a US Social Security Number input in Shack Forms.

To validate input of your Shack Forms fields, you must use what is called "regular expressions" or RegEx.

In this post, you will learn how to use one of such regular expressions even if you don't know anything about them.

In some cases, you may need to ensure that your Shack Forms user entered a US Social Security number correctly.

The proper format they must use for a field collecting their US Social Security Number should be NNN-NN-NNN.

  • Open your Shack Forms module for edting.
  • Open the field that needs to me limited only to numeric data.
  • Set the Field type to Text.
  • Enter ^\d{3}-\d{2}-\d{4}$ into the Validation (Regular Expression) field:

us social security number regex

  • Click Save or Save & Close.

What's Next?


What's Next?

Save $1,000's when you sign up for Joomlashack's Everything Club.

You will get your hands on our extensive range of over 20 extensions, plus legendary support!

Click here to join the Everything Club