Skip to main content

Notifications

Announcements

No record found.

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

Can I show/hide a group of fields based on a dropdown value?

(0) ShareShare
ReportReport
Posted on by 105

In a markeiting form, the user can order an info brochure.
Based on the value of a dropdown (by email or by post) the streed address fields should show or hide.

When the user chooses by post, the street address fields should show, when they choose by email they should be hidden.
Is this possible with Dynamics 365 Marketing app forms?

Example here:

hfh_5F00_ani.gif

  • RE: Can I show/hide a group of fields based on a dropdown value?

    Okay, I was able to Hide a section using this code:

    <script>

    MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function(event) {

    document.getElementById('postanschrift').style.display= 'none';

    });

    </script>

    WHAT DOES NOT WORK, is if I want a function to be called when I change the dropdown:

    <script>

    document.getElementById('696494fc-72e0-ea11-a813-000d3a387ed9').onchange = function() {

    document.getElementById('postanschrift').style.display= 'block';

    }

    </script>

    Why does the onchange not work?

  • RE: Can I show/hide a group of fields based on a dropdown value?

    ………………………………………...

  • Suggested answer
    Carlo Velasco Profile Picture
    Carlo Velasco 787 on at
    RE: Can I show/hide a group of fields based on a dropdown value?

    Hi

    Yes, you can extend the functionality of marketing forms through custom code.

    Please refer to:

    docs.microsoft.com/.../marketing-form-client-side-extensibility

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…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans