Hi.
I've used this embed code:
<script src="https://formfielder.com/frm_embed/kkp"></script>
on a static site at https://38105-old-pond.site.hardypress.com/ (development site, not production)
And I'm getting this Console error:
===
Uncaught TypeError: can't access property "setAttribute", document.getElementById(...) is null
<anonymous> https://38105-old-pond.site.hardypress.com/contact/ line 7 > injectedScript:1
injectScript https://formfielder.com/frm_embed/kkp:7
injectScripts https://formfielder.com/frm_embed/kkp:5
each https://formfielder.com/frm_embed/kkp:8
injectScripts https://formfielder.com/frm_embed/kkp:5
loadDelayedScripts https://formfielder.com/frm_embed/kkp:4
listenForScriptLoad https://formfielder.com/frm_embed/kkp:5
callbackWrapper https://formfielder.com/frm_embed/kkp:7
injectScript https://formfielder.com/frm_embed/kkp:7
injectScripts https://formfielder.com/frm_embed/kkp:5
each https://formfielder.com/frm_embed/kkp:8
injectScripts https://formfielder.com/frm_embed/kkp:5
loadInitialScripts https://formfielder.com/frm_embed/kkp:4
handleReadyStateChange https://formfielder.com/frm_embed/kkp:5
EventHandlerNonNull* https://formfielder.com/frm_embed/kkp:2
<anonymous> https://formfielder.com/frm_embed/kkp:8
===
The form still seems to work fine. Is this fixable?
Thanks.
Maybe I am missing something but what are you embedding? You have script tags with a url, but nothing is being called? Are you trying to load a form from one site onto another? Maybe an iframe would be better.
I've never seen that particular method for embedding a form on a 3rd-party WordPress site. Normally, you would use the API, https://formidableforms.com/knowledgebase/formidable-api/#kb-show-a-form-on-another-wordpress-site.
The JavaScript error you're receiving is because the script is looking for an element with the ID of "ak_js_1". This is not a Formidable generated ID. The injected scipt is not searchable when viewing your page's source code. Whatever the problem is, it's with the script you're embedding from the formfielder site. It needs to be fixed there, or use the API as Formidable's documentation recommends.
document.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() );
I've followed the instructions exactly from How to Embed a Form on Any Website (Not Only WordPress!) (formidableforms.com)
It's a relatively new feature.
I forgot you could do that with Formidable. Never had a requirement to do this myself. I won't be able to help you with this one.
Please login or Register to submit your answer