Can I use something like Chosen with embed Marketo forms?

Anonymous
Not applicable

Can I use something like Chosen with embed Marketo forms?

Hi there,

We were using forms v.1 and a jquery plugin called Chosen to style our dropdown fields (http://harvesthq.github.io/chosen/). Now that we've moved to the embedded v.2 forms on our site these styled select fields have lost the formatting.

I'm assuming it's because the new forms are embedded via javascript and Chosen also uses javascript, looks for select fields and replaces them with more standard HTML elements so it's easier to style. There's a conflict or parse order somewhere, but I'm not sure where to start. 

Do the Marketo forms ignore all other JS on my site? And if so, is there a way around that so that we can continue to use Chosen for styling our dropdowns?
Tags (1)
2 REPLIES 2
Anonymous
Not applicable

Re: Can I use something like Chosen with embed Marketo forms?

You could add a delay to the Chosen JS to implement it after the form is loaded. I did that on this page; I have a 400ms delay to apply Bootstrap styles to my forms.

http://go.servicetrade.com/Practical-Guide-to-Buying-Software-for-Service-Contractors.html

You're welcome to pillage the code 🙂
Alok_Ramsisaria
Level 10

Re: Can I use something like Chosen with embed Marketo forms?

In addition to Jason's response,

You can call your Chosen JS only when Form elements are loaded.