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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

Having selection trigger topic field to be populated with content

(0) ShareShare
ReportReport
Posted on by 15

Hello,

I am migrating our current forms from Gravity forms integrated into our Dynamics CRM to Dynamics Marketing. We currently have a form that has radio buttons with different options. When the user selects one of the radio button options, it triggers whatever item they choose to populate a hidden field under "Topic" in our CRM. 

I need help on how to accomplish this using Dynamics Marketing please.

Thanks,

Mariah

I have the same question (0)
  • Verified answer
    cloflyMao Profile Picture
    25,210 on at

    Hi Mariah,

    In Dynamics Marketing, we can accomplish it with javascript.

    The script will execute after form is rendered.

    MsCrmMkt.MsCrmFormLoader.on('afterFormLoad', function (event) {
        var radiobtnList = document.querySelectorAll('input[type="radio"]');
        for (var i = 0; i < radiobtnList.length; i  ) {
            radiobtnList[i].addEventListener('change', function () {
                if (this.checked) {
                    document.getElementsByTagName("input")[0].value = this.nextSibling.innerText;
                }
            })
        }
    })

    In my marketing form, the Topic field is the first field, so index number of document.getElementsByTagName("input")[0.value is 0, please adjust the number based on your environment.

    pastedimage1594711543166v1.png

    Result:

    The topic field of new lead has been set to text of checked radio button option.

    pastedimage1594711751655v2.png

    Regards,

    Clofly

  • cloflyMao Profile Picture
    25,210 on at

    Hi Mariah,

    Could it work for you?

    Regards,

    Clofly

    If you had found any answer helped, please kindly mark as verified to close the thread, it would be really appreciated.

  • mariahmays21 Profile Picture
    15 on at

    Yes, thank you. It did work for us!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 189 Super User 2026 Season 1

#2
CU11031447-0 Profile Picture

CU11031447-0 100

#3
NeerajPawar Profile Picture

NeerajPawar 66

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans