Solved! Go to Solution.
Hey Rasmus,
I'd suggest using the whenReady callback instead, as it waits until the form is completely done loading likie this:
MktoForms2.whenReady( function(form){
$('#mktoForms2BaseStyle').remove();
$('#mktoForms2ThemeStyle').remove();
});
Hey Rasmus,
I'd suggest using the whenReady callback instead, as it waits until the form is completely done loading likie this:
MktoForms2.whenReady( function(form){
$('#mktoForms2BaseStyle').remove();
$('#mktoForms2ThemeStyle').remove();
});
Hi Kenny Elkington, our team is experiencing issues with this two years after this original thread was opened. Could you provide some more insight please?
One of our forms is still referencing the forms2.css stylesheet which is affecting how the form renders. We have been using this form for over one year and we've only just noticed the bug in the past week. Additionally, the bug only seems to affect 1 out of every handful of loads so it is inconsistent. We also tested using an older form using the same "Plain" theme, and we have not experienced any issues with that other form, which leads us to believe this is form-specific.
Marketo support initially told us that the styling error on our form is coming from our page, but as you can tell from the attached screenshot, the forms2.css stylesheet is clearly being referenced by the form itself and not our page. You can even see the comment in line 1 that says "This is used to test if the stylesheet has been loaded yet" so we think the form is supposed to stop referencing forms2.css once it has been loaded, but for whatever reason, it doesn't clear out properly.
Our main question is, how do we get this form to stop referencing forms2.css? And why does it seem like it only affects specific forms even if the themes are the same? Thank you!
Just use the Destyle Marketo Form JS. It completely disables Forms 2.0 styles and stylesheets.