Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

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

Email Validation on Landing Page

(0) ShareShare
ReportReport
Posted on by 10

Very new to the Marketing app, so this answer may be very obvious.

I created a Landing Page that acts as a 'Contact Us' page on our company's website. Upon submission of the form, the submitter receives an email thanking them for their submission and letting them know someone will follow up shortly.

I recently ran into an issue where few form submitters did not enter their email address correctly, so it caused a hard bounce of the outbound email to them. We've all seen forms that have an email field, and a 2nd email verification field that compares what's in both fields, and throws an error if they don't match. Is there any way to implement this on a Landing Page? Or are there any other suggestions on how to deal with someone accidentally entering their email wrong?

Thanks.

Mike

  • Mike M 904 Profile Picture
    Mike M 904 10 on at
    RE: Email Validation on Landing Page

    Worked exactly as you outlined. Thanks again!

  • Mike M 904 Profile Picture
    Mike M 904 10 on at
    RE: Email Validation on Landing Page

    Clofly,

    Thanks so much for taking the time to outline this. I'll definitely give this a shot, although I doubt my Marketing team will let me stop the live page, so this may be something I try for the next one.

    Thanks again, much appreciated!

    Mike

  • Verified answer
    cloflyMao Profile Picture
    cloflyMao 25,202 on at
    RE: Email Validation on Landing Page

    Hi Mike,

    You could create a new form field record, taking the Email Address 2 field of Contact as the 2nd email field for verification.

    pastedimage1602039219597v1.png

    Custom validation can be added to form with form API:

    At formSubmit event, check whether value of Email is equal to value of the 2nd email field, if yes, allow submission;

    if not, prevent submission and show an alert with error message to contacts.

    1. In form editor, set both of email fields to be required.

    2. Go live the landing page which is embedded with marketing form, get the id value of two email fields with inspector.(F12)

    4456.JPG

    3. Stop the live page, add following validation code after end tag of body, nest code in script tag.

    Replace id in sample code with your owns.

    6082.JPG

    MsCrmMkt.MsCrmFormLoader.on('formSubmit', function (event) {
    
    var verifyEmail = document.getElementById('frm24da2d4af-3e08-eb11-a813-000d3aa08990').value;
    
    var email = document.getElementById('frm2e1dfc514-f301-4cb2-855a-4c8fa8331207').value; 
    
    if (verifyEmail !== email) {
        event.preventDefault();
        alert("Make sure that the value of 'Email' is equal to the value of 'Verify your email'.");
    }
    
    });

    Result:

    Contact will receive an error message if value of two fields are not equal.

    pastedimage1602040731372v1.png

    Regards,

    Clofly

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,494 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,307 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans