web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Answered

Duplicate Validation for Portal Form

(0) ShareShare
ReportReport
Posted on by

Hi,

I am trying to add validations for a field in the web forms where it shouldn't allow email address duplication in the system. I am not sure how to add the validation. Can someone help me with this?

//Email Validator
            var emailValidator = document.createElement('span');
            emailValidator.style.display = "none";
            emailValidator.id = "emailaddressValidator";
            emailValidator.controltovalidate = "emailaddress1";
            emailValidator.errormessage = "The email you have entered is already in the system. PLease enter a different email address.";
			emailValidator.validationGroup = ""; // Set this if you have set ValidationGroup on the form
            emailValidator.initialvalue = "";
            emailValidator.evaluationfunction = function() {
                // only require email address if preferred contact method is email.
                if ($("#emailaddress1").val() == (NOT SURE HOW TO READ CRM DATA IN HERE)) {
                    return false;
                } else {
                    return true;
                }
            };

I have the same question (0)
  • Suggested answer
    Inogic Profile Picture
    766 on at

    Hi Harsha,

    The ideal solution for restricting the duplicate emails in the system is to write a plugin that will run on the server-side and restricts the user if an email address already exists in the system.

    To allow plugin validation messages to be visible in the portal form, you need to create a Site Setting called: Site/EnableCustomPluginError and set the value as True.

    Hope this helps!

  • Community Member Profile Picture
    on at

    Thank you very much Roohi. This was very helpful.

  • Community Member Profile Picture
    on at

    If you could, can you help me with one more aspect of this problem

    community.dynamics.com/.../display-plugin-error-in-the-middle-of-portal-page

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 142 Super User 2026 Season 1

#2
Nagaraju_Matta Profile Picture

Nagaraju_Matta 128

#3
ManoVerse Profile Picture

ManoVerse 127 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans