SOLVED

Remove tha auto-generated forms2.css

Go to solution
Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

So there's really no way to prevent loading of the stylesheets in the first place? Ultimately I would love to get rid of the two stylesheet requests marketo makes. Any other options?
Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

Josh you can create two empty divs width IDs "mktoForms2ThemeStyle" and "mktoForms2BaseStyle":
<div id="mktoForms2BaseStyle">
    <div id="mktoForms2ThemeStyle"></div>
​</div>

In the Forms2.js is a simple condition on the availability of these ID anywhere on the page
Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

I guess my question is the following:

where do you even access these files?

SanfordWhiteman
Level 10 - Community Moderator

Re: Remove tha auto-generated forms2.css

where do you even access these files?

You don't edit forms2.css -- if that's what you're asking -- you override it just as you would with any default stylesheet.

Rasmus_Bidstru1
Level 4

Re: Remove tha auto-generated forms2.css

I have found the best way for me is just use Marketo forms as hidden fields, and then field out the input fields with jquery. This way I have total control over all the styles.

SanfordWhiteman
Level 10 - Community Moderator

Re: Remove tha auto-generated forms2.css

As long as you still use the Forms 2.0 API to submit the form, yes, you don't need the visible form to be a Marketo form.

Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

Interesting approach…just remove the Marketo form altogether. Would be good for when you're working on your own site, not sure how easy it would be for me to implement with clients

Grégoire_Miche2
Level 10

Re: Remove tha auto-generated forms2.css

Hi Jason,

It's not removing it, it's hiding it . Then when the lead fills out your CMS form, you trigger the Marketo one in the background. So in order to do this, it has to be present.

See Kenny's guide for this: Make a Marketo Form Submission in the background

-Greg

Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

Could also remove the need for a Marketo form altogether with the Server-side Form Post

Anonymous
Not applicable

Re: Remove tha auto-generated forms2.css

What I'm trying to achieve is not remove the form, but be able to control the markup of the form.
Currently, the nesting of div's used for layout is making that job for me a little difficult. attached is an image illustrating the issue. Untitled-1.png