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,...
Suggested Answer

Error: form was not recognized as valid for form capturing.

(0) ShareShare
ReportReport
Posted on by 5

Hello everyone.

So i'm working on a form for a client and I've been provided some scripts that generate the form.

The form appears on the page nicely and everything appears to work but the submissions. 

My formSubmit event looks like this and it goes through...

MsCrmMkt.MsCrmFormLoader.on('formSubmit', (e) => {
	e.preventDefault();
	window.formSubmitResult = MsCrmMkt.MsCrmFormLoader.sendFormCaptureToCrm(el.querySelector('form'));
	formSuccess();
	console.log("MsCrmMkt.MsCrmFormLoader.on('formSubmit') called.");

	console.log('result: ', window.formSubmitResult);
});


 but window.formSubmitResult outputs:

"Error: form was not recognized as valid for form capturing.
    at FormCaptureSendingQueue.sendingCallback (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:290023)
    at https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:36078
    at M (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:2680)
    at new t (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:5913)
    at FormCaptureSendingQueue.enqueue (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:36012)
    at Function.FormLoaderInternal.sendFormCaptureToCrm (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:38959)
    at http://ppe.wpup.lt/wp-content/themes/ppe/assets/js/app.js?ver=1.0.1:30396:58
    at Function.FormLoaderInternal.triggerCallbacks (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:37688)
    at Function.FormLoaderInternal.trigger (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:37805)
    at FormLoaderInternal.trigger (https://mktdplp102cdn.azureedge.net/public/latest/js/form-loader.js?v=1.71.2017.0:4:37434)"


I've tried adding and removing various attributes i've found in the documentation like data-no-submit="true" and data-ignore-prevent-default="true" but it doesn't seem to work.

According to client the visits are getting tracked but there are no submissions.

The form can be accessed here: http://ppe.wpup.lt/contact/ , you can fill it with method window.fillForm()

Anybody can help me with this one? 

I have the same question (0)
  • Suggested answer
    Nya Profile Picture
    29,064 on at

    Hi,

    Please refer to the following section:

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

     

    It shows that the formSubmit event will not be triggered for captured forms.

     pastedimage1625814694545v1.png

    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

  • donnervetter Profile Picture
    5 on at

    Hey Nya, thank you for your answer. My problem is that however I try to submit it returns the same error.

    Even if I try submitting it from the console like that:

    MsCrmMkt.MsCrmFormLoader.sendFormCaptureToCrm(el.querySelector('form'));


    The outcome is always the same: "Error: form was not recognized as valid for form capturing.". 

    Is there a way to know what makes the form unrecognisable for capturing?

  • thecharwest Profile Picture
    221 on at

    I'm having a similar issue with the same error - I don't suppose you've found a solution have you? :)

  • AriaConsulting Profile Picture
    4 on at

    I think possibly you missed the key point from what Nya replied: you can't use "formSubmit".  You CAN use "afterFormSubmit".

  • Suggested answer
    nickmcelligott Profile Picture
    5 on at

    It's looking for a `data-form-page-id` attribute on the `form` element, not sure why, but its not there. So you can manually add it before it submits;


    <script type="text/javascript">
    let formPageId;

    MsCrmMkt.MsCrmFormLoader.on("formLoad", function(e) {
        formPageId = e.getFormPageId();
    });

    document.querySelector('#button').addEventListener('click', function() {
        const form = document.querySelector('form');
        form.setAttribute("data-form-page-id", formPageId);
        MsCrmMkt.MsCrmFormLoader.sendFormCaptureToCrm(form).then(function() {
            console.log('submitted');
        }, function(err) {
            console.log(err);
        });
    });
    </script>

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
ManoVerse Profile Picture

ManoVerse 151 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 134

#3
Jimmy Passeti Profile Picture

Jimmy Passeti 55 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans