03 March 2016

E-mail address validation in Sitecore WFFM

The e-mail validation that comes with WFFM marks e-mail addresses with top level domains of 5 characters or more as invalid (for instance sitecoredeveloper@some.education). Luckily, you can change the regular expression that is being used. Open the Sitecore Client and go to /sitecore/system/Modules/Web Forms for Marketers/Settings/Validation/E-mail and alter the Validation Expression field.

The default value is: ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$
Change it to: ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}$

The difference is that the last part of the e-mail address has no limitations on the number of characters.