Skip to main content

Notifications

Announcements

No record found.

Customer Insights - Journeys forum

Javascript in Marketing forms

Posted on by

Hi 

Our marketing form is hosted at a landing page in the customers own CMS system.

We need to add some javascript code to the form to validate some field content.

When we open the landing page with our marketing form the script code is lost. It seems it is extracted from the form.

Is there any way to overcome this issue?

Thanks 

Torsten

  • Suggested answer
    PoojaBhardwaj Profile Picture
    PoojaBhardwaj 5 on at
    RE: Javascript in Marketing forms

    You can follow the below link, this might be helpful for you.

    medium.com/.../add-validations-using-javascript-to-marketing-form-in-dynamics-365-d769816f58b8

  • TGT Profile Picture
    TGT 135 on at
    RE: Javascript in Marketing forms

    I am also curious when this will be released.

    We also have a few 3rd party CRM providers and it would be preferred to update the javascript code on the form our self instead of waiting for CMS provider to do it for us...

  • Verified answer
    ShravanSuri Profile Picture
    ShravanSuri 1,255 on at
    RE: Javascript in Marketing forms

    Hey Torsten,

    We're bringing this functionality in an upcoming update, but right now, you can add the JS code on the landing page itself to perform this validation. Essentially, you hook up on afterformload, at this point our submit handler is attached; hijack it (store it somewhere), replace it with handler that will prevent default, run the validation you'd want to run and if validation is successful, run the original submit handler.

    Please reach out to me (Shravan.suri@microsoft.com) if you require further assistance with this.

    Regards,

    Shravan

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans