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

Community site session details

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

Where to put javascript on a marketing form?

(0) ShareShare
ReportReport
Posted on by

Hi,

I am trying to create a Marketing Form that will be embedded on an external page (not on an Marketing Page created in Dynamics). I have a javascript function that should execute on afterFormLoad (because it uses some fields from the form). I understand that is not recommended to embed the javascript inside the HTML code of the Marketing Form because additional content will always be cleared. Refer this post: https://community.dynamics.com/365/marketing/f/dynamics-365-for-marketing-forum/417003/extending-marketing-forms-with-javascript/1141818#1141818

Is putting the script on the page itself the only viable option? There isn't another way to embed the javascript in the code of the Marketing Form without to worry that it will be cleared everytime the form will be updated?

Thank you.

I have the same question (0)
  • Verified answer
    Nya Profile Picture
    29,060 on at
    RE: Where to put javascript on a marketing form?

    Hi,

    Please refer to the following documentation to know more about how to extended marketing form using JavaScript.

    Extend marketing forms using code (Dynamics 365 Marketing Developer Guide) | Microsoft Docs

     

    If this helped you, I'd appreciate it if you'd mark this as a Verified Answer, which may in turn help others as well.

    Best Regards,

    Nya

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Hamza H Profile Picture

Hamza H 141

#2
Daniyal Khaleel Profile Picture

Daniyal Khaleel 132

#3
DAnny3211 Profile Picture

DAnny3211 130

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans