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

Can you add javascript directly to a Marketing form without having to create a landing page?

(0) ShareShare
ReportReport
Posted on by 183

Hi,

I know how to extend forms using javascript but so far it only looks like it works by adding the script to a landing page you create instead of directly to the marketing form itself in the HTML portion of the editor. Is this still not supported?

I have the same question (0)
  • Community Member Profile Picture
    on at

    Hi pdr469,

    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

  • pdr469 Profile Picture
    183 on at

    I’m aware of the article but the article doesn’t specify if you can directly modify the form itself with JavaScript. Does anyone know if that’s supported?

  • Community Member Profile Picture
    on at

    Hi pdr469,

    Add JavaScript code on your Marketing form and test this custom code using marketing pages.

    Add validations using JavaScript to Marketing form in Dynamics 365 | by Pooja Bhardwaj | Medium

  • pdr469 Profile Picture
    183 on at

    That still sounds like you have to add the script to a page later and not to the form itself. I’m looking for a supported way to add the code directly to the form within the form designer HTML.

  • Verified answer
    Petr Jantac Profile Picture
    Microsoft Employee on at

    The javascript inside the HTML code of the form is supported. But there are some limitations, like certain events are triggered before the form markup is injected into a page, those won’t be available for the script added within a form.

    Thank you.

    Petr

  • immilev Profile Picture
    on at

    No, you can't.  In Dynamics marketing forms are of 3 types, one of them being Landing Page. Technically, you can't have a marketing form without a page for it.

  • Suggested answer
    Stefano Sala Profile Picture
    15 on at

    Hi Phil,

    I regularly use some Js code to add functionality to the Dynamics 365 marketing module. For example, I use it to give dynamicity or to create conditions for visibility of certain fields.

    As @Petr Jantač rightly pointed out, however, this definitely has limitations. To understand this, one must consider that the marketing module, and thus its code, is loaded in a specific order within the web page (creating a D365 marketing page or embedding the module in one's own web pages).

    In any case, you can test your customizations in real-time with tools such as Visual Studio Code or other tools that allow you to have a graphical preview online.

    Happy coding!

    Regards,

    Stephen

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

#2
NeerajPawar Profile Picture

NeerajPawar 65

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 51 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans