Skip to main content
Duane_Kennerson
Level 4
March 3, 2016
Question

.mktoFormCol (2 column form... sort of)

  • March 3, 2016
  • 1 reply
  • 4374 views

Well, I have a need to use a two column layout but some of my inputs need to be 100% width of the form. It's seems that as soon as I drag a form field into a second column, every input gets put into a div with the .mktoFormCol class. How can I override .mktoFormCol on only some inputs?

Any thoughts?

Thanks

1 reply

Grégoire_Miche2
Level 10
March 3, 2016

Hi Duane,

You are hitting one limitation of the forms 2.0: Marketo is not assigning IDs to form elements, which makes it difficult to style one or few of them differently.

I remember that @Sanford Whiteman​ wrote quite a few things on this, including a method to add distinct ids or classes to each element, so that they can be styles easily, but I have not been able to find the post.

-Greg

Duane_Kennerson
Level 4
March 4, 2016

Hey Greg,

Yeah, I figured that would be the case when looking at the code it spit out. We are just going to use the API with our current styled forms and not worry about building them in Marketo.

Would like to see the ability to:

-Give each form element their own id

-Override the two column css. Maybe a check box that allows the input to span the entire width of the container

-Set percentages for input widths

SanfordWhiteman
Level 10
March 4, 2016

I hope you mean the Forms 2.0 API when you say "API."

What Greg is referring to is a code snippet like the one in MktoForms2 :: Tag Wrapper Elements. I include such a script whenever I want to tweak a Marketo form.  As you can see, you can then use CSS to easily manipulate the container DIVs by the name of the form fields they contain.