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

Duane_Kennerson
Level 4

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

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

11 REPLIES 11
Grégoire_Miche2
Level 10

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

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

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

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 - Community Moderator

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

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. 

Duane_Kennerson
Level 4

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

We didn't end up using the API. We did a simple cURL post method to insert the the data from the form into Marketo. This way we didn't have to mess with our current forms and the styling headaches we were getting.

Do you see an issue with that? We're really new to Marketo...

Anonymous
Not applicable

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

Hi Duane,

If you use cURL to post your form data to Marketo server, the lead will be created / updated fine.

But lead's machine will not be 'cookied' by Marketo. So all the powerful functionality Marketo brings to table like, tracking website visits, pre-filling form fields, progressive profiling etc would not work that well till that lead gets cookied.

Rajesh

Duane_Kennerson
Level 4

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

Hey Rajesh,

On this page: http://developers.marketo.com/blog/server-side-form-post/  on the developer site, it has this section:

(2) _mkt_trk – this field carries the cookie information, so you’ll be able to track the individual’s web page visits. If you have Munchkin on your form page, Munchkin will automatically enter a value in this hidden form field. If not, read it from the cookie with the same name and pass it to Marketo in this field.

Which we are sending to Marketo. In our dev environment, it seems to be tracking web activity as expected. Does that cover us or are we missing something?

Thanks for the input!

SanfordWhiteman
Level 10 - Community Moderator

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

Which we are sending to Marketo. In our dev environment, it seems to be tracking web activity as expected. Does that cover us or are we missing something?

That part is covered.

SanfordWhiteman
Level 10 - Community Moderator

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

Do you see an issue with that? We're really new to Marketo...

Yes. It creates a DoS attack vulnerability.  The Forms 2.0 endpoint will only process 30 forms per minute for your entire instance (that includes, of course, malicious use of your forms by hackers).  A mildly successful CTA can easily exceed that limit, and you will never get those leads.  Server-side form posts are not recommended in a professional setting. 

The correct practice when using a custom form is to Make a Marketo Form Submission in the background using the Forms 2.0 API.  This does not affect your ability to design a custom form to your liking, but makes sure that you will not be strictly rate-limited.

(Rajesh also mentioned that you need to include the Munchkin cookie when performing a form post.  This, however, can be done using a server-side form post as long as it is implemented appropriately, so it is not the primary issue.)

Duane_Kennerson
Level 4

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

Hey Sanford, thanks again for all you input on this issue.

We have a honeypot in place that limits form submissions based on several criteria. It's been in place for a couple of years now with no issues so our thinking is that we are covered in that aspect.

We are also sending the cookie data per Marketo's documentation (see my reply to Rajesh). I'm not trying to be difficult but I "think" we are ok on the issues that have been raised. I don't want anyone to throw their hands up and say whatever you dumb asses want to do (lol) so if you feel strongly that this is a bad way to go, just say so.

Such a trivial thing that could be solved by simply allowing id's to form elements...

Thanks!