SOLVED

Re: Integrate a Java Script in a form field

Go to solution
Vincent_Ferugl1
Level 2

Integrate a Java Script in a form field

Hello,

 

I’d like to integrate directly a Java Script in a field in a Marketo form.

The JS will be provided by a 3rd party service. The goal is to help the prospect filling the form to identify his company.

 

I know it’s feasible but I don’t know how to do it, I have just tested with a copy-paste in a rich text field and it failed. Does it require developer skills?

Do you use JS in a field and does it work well? Any issue of slow loading?

 

I have found only one post about this kind of topic.

https://nation.marketo.com/t5/Product-Discussions/Embed-JS-directly-in-a-form/m-p/34559

 

Thank in advance.

Vincent

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate a Java Script in a form field

I explained how to do this here: HOWTO: Add Forms 2.0 JS behaviors inside a Rich Text Area

 

There is no performance impact vs. using a standalone <script> tag outside of the form (i.e. after the form embed code). However, be very wary of bundling code inside the form this way unless you are absolutely sure the code works on its own. Putting it in a Rich Text Area makes it tons harder to debug. Only use the RTA in the situation where you cannot add code beyond the form embed (as in, someone is already using your form embed on another site and won't plug in an additional <script>).

View solution in original post

2 REPLIES 2
SanfordWhiteman
Level 10 - Community Moderator

Re: Integrate a Java Script in a form field

I explained how to do this here: HOWTO: Add Forms 2.0 JS behaviors inside a Rich Text Area

 

There is no performance impact vs. using a standalone <script> tag outside of the form (i.e. after the form embed code). However, be very wary of bundling code inside the form this way unless you are absolutely sure the code works on its own. Putting it in a Rich Text Area makes it tons harder to debug. Only use the RTA in the situation where you cannot add code beyond the form embed (as in, someone is already using your form embed on another site and won't plug in an additional <script>).

Vincent_Ferugl1
Level 2

Re: Integrate a Java Script in a form field

Hi @SanfordWhiteman,

Thank you a lot for your documentation and recommendations.