Can we get form 2.0 embeds without inline styling and CSS?

Anonymous
Not applicable

Can we get form 2.0 embeds without inline styling and CSS?

Our websites have thier own CSS for doing form styling, we'd like to use the new dynamic form embed code from Marketo without any theme or inline styling so that we can take advantage of being able to change fields using Marketo.

Can you make this an option? 
Tags (1)
4 REPLIES 4
Anonymous
Not applicable

Re: Can we get form 2.0 embeds without inline styling and CSS?

Yes, inline styling is painful ;(
Anonymous
Not applicable

Re: Can we get form 2.0 embeds without inline styling and CSS?

+1

I wholeheartedly agree, but also for forms within Marketo pages (I believe the form HTML is the same either way based on the 'style' you choose when creating the form). I'm currently using jQuery to remove the inline style attributes when the page loads. However, if there is even a little hiccup this blows up the forms. VERY frustrating!

My next step is to try and overwrite the styles with CSS (using !important) to see if that works instead. I've included the jQuery we're using to strip out the code, but use at your own risk as the way the forms are loaded in could prevent the jQuery from running properly (we think it's a timing issue).

 
 
  <script>
    // use no conflict mode for jQuery
    var $ = jQuery.noConflict();
    $(document).ready(function() {
 
      // Remove Marketo form css (why can't we just disable this? So frustrating!)
      $('#mktoForms2ThemeStyle').remove();
      $('#mktoForms2BaseStyle').remove();
 
      // Strip out inline styling (seriously, why do we even have to do this?!)
      $('.mktoHasWidth').each(function() {
        $('.mktoHasWidth').removeAttr("style");
      });
      $('.mktoOffset').each(function() {
        $('.mktoOffset').removeAttr("style");
      });
      $('.mktoNative').each(function() {
        $('.mktoNative').removeAttr("style");
      });
      $('.mktoFormCol').each(function() {
        $('.mktoFormCol').removeAttr("style");
      });
    });
  </script>

Hopefully this helps someone out. Would love to see other's thoughts on this. Together we CAN overcome poorly provided forms!
Anonymous
Not applicable

Re: Can we get form 2.0 embeds without inline styling and CSS?

Super Helpful. Thanks Heath
Anonymous
Not applicable

Re: Can we get form 2.0 embeds without inline styling and CSS?

Agreed... So frustrating!