SOLVED

Embedded Forms 2.0 Duplicating in Drupal

Go to solution
Anonymous
Not applicable
Has anyone run into the issue when embedding a form on Drupal7, that the form appears without the custom CSS, and it is duplicated on the page?  If so, what was the fix?0EM50000000SzA4.jpg

 
Tags (1)
1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator
OK, found it after some hunting.

Your jQuery "mmenu" plug-in duplicates the Marketo form... if it runs after the Marketo Forms 2.0 has been rendered.

Solution: Render the Marketo form after the mmenu is finished.  Put the Marketo code at the end of this block:

$(document).ready(function() {
var $mmenu_right = $("#mmenu_right");
       
...

MktoForms2.loadForm("//app-sjn.marketo.com", "417-GUB-995", 1442, function(){
jQuery('form#mktoForm_1442').addClass('munchkin-processed');
});

}(jQuery))

Also make sure the Marketo <SCRIPT> tag is in your <HEAD>.

View solution in original post

8 REPLIES 8
Anonymous
Not applicable
This worked, thank you @Sanford!
SanfordWhiteman
Level 10 - Community Moderator
OK, found it after some hunting.

Your jQuery "mmenu" plug-in duplicates the Marketo form... if it runs after the Marketo Forms 2.0 has been rendered.

Solution: Render the Marketo form after the mmenu is finished.  Put the Marketo code at the end of this block:

$(document).ready(function() {
var $mmenu_right = $("#mmenu_right");
       
...

MktoForms2.loadForm("//app-sjn.marketo.com", "417-GUB-995", 1442, function(){
jQuery('form#mktoForm_1442').addClass('munchkin-processed');
});

}(jQuery))

Also make sure the Marketo <SCRIPT> tag is in your <HEAD>.
Akhila1994
Level 1

HI Sanford, 

I have embedded Form 2.0 in the WordPress page, but it was duplicating.

The same form I have used on different pages in WordPress there is working fine.

Akhila1994_0-1662600404123.png

Can you please suggest how this can be solved

SanfordWhiteman
Level 10 - Community Moderator
Please open a new thread and provide your URL.
Bonnieliu
Level 1

@SanfordWhiteman Thanks for sharing this!

Curious, is this still working for you. Not sure if anything has changed since 2015, but our developer didn't find this solution to work in Drupal today. Do you have any other suggestions or ideas of what we can try to resolve to the duplication of forms in Drupal?

SanfordWhiteman
Level 10 - Community Moderator

You'd have to provide your page. And pls open another thread in Products, this is way too old.

Anonymous
Not applicable
SanfordWhiteman
Level 10 - Community Moderator
Wow, pretty cool.  Kidding, but... I would assume the code is literally running twice and/or there are two identical container DIVs (which is actually not allowed in HTML standard but it may cause this kind of screwup).  What's the URL?