Posts

Showing posts from April, 2018

Sitecore 9 Forms - Server validation - “Email already exists”

Image
Don’t want to save the duplicate data in the form? This is very basic requirement for each type of forms,
Email id should be unique, let’s think the subscription form, where email id is the primary key, we need to validate the unique email id before save the form data. – “email already exists”
In this blog I will explain, how we can place the server-side validation (email already exists) in the new Sitecore 9 forms module.



Let’s start with Sitecore 9 forms, open the form in the Sitecore:
Create the form as per your requirement and drag email field in the form:


Client validation for Email Address
Select the email field > go to the validation section on the right section Checked the email validator checkbox for checking the valid email id. We can also change the regular expression of the default Sitecore email validator as below:
Go to /sitecore/system/Settings/Forms/Validations/Email Validator In parameter field, change the value of regular expression as below:

Add email validator in the form…