Re: Formatting Forms with Javascript help

Anonymous
Not applicable

Formatting Forms with Javascript help

I am working on formating a form into two colums by following the Marketo Resource found here:

http://community.marketo.com/MarketoResource?id=kA650000000GttkCAC

The part that I am getting stuck on is creating line breaks. The resource says

Add this inside the $jQ(document).ready() javascript block:
$jQ('#Company').parents('li').css('clear','both');
$jQ('#Email').parents('li').css('margin-bottom','20px');

here is a screen shot of my code- I highlighted the code I added in. Can someone tell me what it is that I am doing wrong .

0EM50000000RAf0.jpg
 

Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Formatting Forms with Javascript help

Or does anyone have an example of code where you've implemented a line break in a form?
Anonymous
Not applicable

Re: Formatting Forms with Javascript help

Hi Jessica,

It's hard to say without seeing your form and the page. Are you using the right selectors? (#Form_Type and #First_Name.) It looks like that's really the only difference between your code and Marketo's recommended code.

I tried to follow that tutorial to create a 2-column form, too and I was a little disappointed with what I was able to achieve. I ended up pulling out the form code, then pasting it back in with an HTML element. This was my final product: http://pages.carefusion.com/email.html.

The only sacrifice is that it's a little harder to update if there are changes to the form, and you can't do pre-population. In this case it was worth it for me because pre-population wasn't necessary, and this form doesn't change very often.