How to Validate US Social Security Number Field in Shack Forms

In some cases, you may need to ensure that your Shack Forms user entered a US Social Security number in a proper format 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.