Your software
My Mautic version is: v2.15.3
Your problem
I’ve created a form and included it on the page using the manual copy.
I’m using WordPress, so, in the page, I added the code of the form in the body:
<div id="mauticform_wrapper_comnewsletter" class="mauticform_wrapper">
<form autocomplete="false" role="form" method="post" action="https://my.domain.com/form/submit?formId=2" id="mauticform_comnewsletter" data-mautic-form="comnewsletter" enctype="multipart/form-data">
<div class="mauticform-error" id="mauticform_comnewsletter_error"></div>
<div class="mauticform-message" id="mauticform_comnewsletter_message"></div>
<div class="mauticform-innerform">
<div class="mauticform-page-wrapper mauticform-page-1" data-mautic-form-page="1">
<div id="mauticform_comnewsletter_email" data-validate="email" data-validation-type="email" class="mauticform-row mauticform-email mauticform-field-1 mauticform-required">
<span class="mauticform-helpmessage">La tua migliore email</span>
<input id="mauticform_input_comnewsletter_email" name="mauticform[email]" value="" placeholder="La tua migliore email" class="mauticform-input" type="email">
<span class="mauticform-errormsg" style="display: none;">This is required.</span>
</div>
<div id="mauticform_comnewsletter_segui_miosito" class="mauticform-row mauticform-button-wrapper mauticform-field-2">
<button type="submit" name="mauticform[segui_miosito]" id="mauticform_input_comnewsletter_segui_miosito" value="" class="mauticform-button btn btn-default">Segui Mio Sito</button>
</div>
</div>
</div>
<input type="hidden" name="mauticform[formId]" id="mauticform_comnewsletter_id" value="2">
<input type="hidden" name="mauticform[return]" id="mauticform_comnewsletter_return" value="">
<input type="hidden" name="mauticform[formName]" id="mauticform_comnewsletter_name" value="comnewsletter">
</form>
</div>
Then I added the JavaScript required:
<script type="text/javascript">
/** This section is only needed once per page if manually copying **/
if (typeof MauticSDKLoaded == 'undefined') {
var MauticSDKLoaded = true;
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.type = 'text/javascript';
script.src = 'https://my.domain.com/media/js/mautic-form.js';
script.onload = function() {
MauticSDK.onLoad();
};
head.appendChild(script);
var MauticDomain = 'https://my.domain.com';
var MauticLang = {
'submittingMessage': "Please wait..."
}
}
</script>
I didn’t changed anything.
The form is configured to send an email to the contact and when the form is submitted, the email is sent twice.
I also see in the results of the form that there are two records and they are the same and at the same time, as if the form submission simply creates two records for one submission.
Any ideas about what is the cause of this strange issue?
Any advice that helps to debug the problem is very appreciated!