Skip to main content

Notifications

Community site session details

Community site session details

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

Form submission in Marketing Form in JavaScirpt

(0) ShareShare
ReportReport
Posted on by 30

Hello, 

is it possible to change Marketing Form Attributes in JavaScript and automatically submit the form. 

I added a script inside the parent Marketing Page and I can interact with the event-object.

Right now I'm not able to submit the form.

(function() {
MsCrmMkt.MsCrmFormLoader.afterformrender = function() {

//code here

event...

};
})();

Is there a supported way to submit the form data directly in this method? I just found this documentation:

https://docs.microsoft.com/en-us/dynamics365/marketing/developer/marketing-form-client-side-extensibility

Thank you

  • Suggested answer
    Nishant Rana Profile Picture
    11,325 Microsoft Employee on at
    RE: Form submission in Marketing Form in JavaScirpt

    One option is to call the click event of the submit button - nishantrana.me/.../

  • Nishant Rana Profile Picture
    11,325 Microsoft Employee on at
    RE: Form submission in Marketing Form in JavaScirpt

    Hi Defne,

    Hope you are doing well.

    Which method are you referring in the document for form submission ? We could see one for formcapture, is there a similar method for embedded form

    learn.microsoft.com/.../marketing-form-client-side-extensibility

    Something like this - developers.marketo.com/.../

    Regards,

    Nishant Rana

  • Verified answer
    Defne Ayanoglu Profile Picture
    on at
    RE: Form submission in Marketing Form in JavaScirpt

    Hi Patrick, 

    Were you able to fix the issue? 

    You could also use the afterFormLoad event. You can attach the submission code to the afterFormLoad event and trigger a submission event for the form. 
    It's in the same documentation on extensibility.

    Hope this helps.

    Regards, 
    Defne
  • cloflyMao Profile Picture
    25,208 on at
    RE: Form submission in Marketing Form in JavaScirpt

    Hi Patrick,

    Could you let me know what customization would you like to add to marketing form? Such as populating form fields with data after the form is rendered.

    Why couldn't you submit the form? Please open console and check whether there is any error.

    If using embedded marketing form, it is not supported to submit data with code directly.  

    You could switch to form capture and send submission manually with sendFormCaptureToCrm function.

    https://docs.microsoft.com/en-us/dynamics365/marketing/developer/marketing-form-client-side-extensibility#form-capturing-behavior-customization

    Regards,

    Clofly

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106 Most Valuable Professional

#3
Eugen Podkorytov Profile Picture

Eugen Podkorytov 95

Overall leaderboard

Product updates

Dynamics 365 release plans