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

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

    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

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 164 Super User 2026 Season 1

#2
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

#3
NeerajPawar Profile Picture

NeerajPawar 42

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans