Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Suggested answer

How to verify Mobile phone field in marketing form

Posted on by 25

Hi,

I currently using Marketing Forms/Pages within Dynamics 365 Marketing and I've noticed that client can submit Text in field "mobile phone".

Let's say that you have a sign up form containing phone numbers and the Marketing Form Fields. How can you then validate that people submit the form with the correct number value in mobile phone field? 

Thanks in advance,

Regards,

DB.

  • Suggested answer
    Leah Ju Profile Picture
    Leah Ju Microsoft Employee on at
    RE: How to verify Mobile phone field in marketing form

    Hi Partner,

    You can achieve it easily through Editing phone field in HTML editor of marketing form:

    (1)Check the HTML of the marketing form, the phone type is 'tel':

    pastedimage1668047024147v1.png

    Then i add pattern attribute to the <input> tag, which specifies a regular expression:

    Note: The pattern attribute works with the following input types: text, date, search, url, tel, email, and password.'

    My example: placeholder="123-45-678" pattern="[0-9]{3}-[0-9]{2}-[0-9]{3}"

    pastedimage1668048353110v4.png

    When i try to submit form with wrong format phone number, message will appear:

    pastedimage1668047904525v3.jpeg

    Correct format:

    pastedimage1668048451861v5.pngpastedimage1668048477649v6.png

    (2) Or you can change type to 'number', then the phone field will only allow numeric input.

    pastedimage1668048574036v7.png

    Test:

    pastedimage1668048783337v8.png

    ===========================

    For complex validation, we can achieve it with form API and custom logic.

    https://docs.microsoft.com/en-us/dynamics365/marketing/developer/marketing-form-client-side-extensibility#examples

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans