I can see that the file is loaded through the console network and it's quite strange that not work. I try also to put my javascript code in a JS action with and without the "add inside domready event" options, but nothing happens.​To be noted that the same form work in joomla, and in the wordpress preview backend.​The only error I can see in the log comes when I focus-out from a text input (same error happens also in the wordpress backend, so I think this is not critical):​semantic.min.js:11 Transition: Element is no longer attached to DOM. Unable to animate. Use silent setting to surpress this warning in production. scale in ​Thanks in advance"> Javascript code not work in Wordpress front-end - Forums

Forums

Javascript code not work in Wordpress front-end

fasenderos 07 Jun, 2020
Hi,
I'm expert with chronoform on Joomla, but this is my first time with CF6 in wordpress.

I created a form (imported from Joomla) that works fine on backend preview, however when I add the form on homepage with the shortcode [Chronoforms6 chronoform="form-alias"] my custom loaded javascript not work.

In the form I have an HTML block with
<script src="<?php echo get_site_url() . '/myfile.js'; ?>"></script>
I can see that the file is loaded through the console network and it's quite strange that not work. I try also to put my javascript code in a JS action with and without the "add inside domready event" options, but nothing happens.

To be noted that the same form work in joomla, and in the wordpress preview backend.

The only error I can see in the log comes when I focus-out from a text input (same error happens also in the wordpress backend, so I think this is not critical):
semantic.min.js:11 Transition: Element is no longer attached to DOM. Unable to animate.  Use silent setting to surpress this warning in production. scale in 

Thanks in advance
fasenderos 07 Jun, 2020
Answer
Never mind, the problem was that the form was loaded twice in the page. In fact the same form were loaded with a widget in the header, but the one in the widget was not showed in the desktop view. I've noticed the presence of the second form by viewing the page with my phone.

It seems to be a known bug that CF 6 shortcode not works in widget https://www.chronoengine.com/forums/posts/t107789/wordpress-choronoforms-v6-shortcode-works-in-pages-not-widgets?keywords=wordpress%20widget
This topic is locked and no more replies can be posted.