Streaming live at 10am (PST)

Javascript too long to embed - Can I split it in two?

I have a form created in ActiveCampaign, but the customizations available aren’t as robust as what WF allows. So I built the layout using WF, then viewed source and hand coded the form HTML and used AC’s form field names to make the form work.

THE FORM WORKS FINE - but I want to add Recaptcha (from AC, not WF), and unfortunately, AC’s javascript validation is super long, so I have to split into 2 separate embeds in WF. This causes issues though, as it appears WF tries to close the tags - or maybe the browser is doing it.

I don’t know javascript. How can I split the embeds and get Recaptcha to appear on the page, or s there a better way? I’ve already tried adding a different form action to the WF forms, but it doesn’t work.

Thanks,
Jason


Here is my site Read-Only:
https://preview.webflow.com/preview/newells?utm_medium=preview_link&utm_source=designer&utm_content=newells&preview=f2de0a0e9b31f1b9a5255f568ab2fe46&pageId=5e48533c9065e73b8c11da03&mode=preview

If I’m understanding correctly, Active Campaigns recaptcha is exceeding the character limit available in the HTML embed element. If that is the case then one option would be to minify it. I’m pretty sure I used this tool previously on a project to solve a similar problem, https://javascript-minifier.com

Does that help?

1 Like

You could also host the script on github and initialize it in Webflow.

1 Like

Perfect! Thank you so much - that was so simple and all I needed. The Github option sounds like a great backup plan too. Thank to you both!
-Jason

2 Likes

You can also save the script as a .txt file, upload it to assets, get the URI, add it as the src value and include type="text/javascript" in the opening script block.

1 Like

That’s a pretty sweet idea! I’ll definitely use that for something moving forward

@webdev Damn ! All those time I went to github. Pretty neat !