Integrate a Java Script in a form field | Community
Skip to main content
Vincent_Ferugl1
New Participant
September 4, 2020
Solved

Integrate a Java Script in a form field

  • September 4, 2020
  • 1 reply
  • 1699 views

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

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>).

1 reply

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
September 4, 2020

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
New Participant
September 9, 2020

Hi @sanfordwhiteman,

Thank you a lot for your documentation and recommendations.