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?

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans