• Resolved crossbeats

    (@crossbeats)


    As the title states – I created a form with a conditional field, and have embedded the form into my template. The conditional field doesn’t work.

    I checked the form on its own page, and the conditional field works fine.

    Here’s a page with the form and conditional fields working as intended: http://staging3.pacelink.com/777-2/

    On every page, I’d like the form to be in the tab on the left (after you scroll down a bit) that says “Feedback” – but as you can see, the Email/Phone Number fields are showing, instead of toggling on when “Contact Me” is checked: http://staging3.pacelink.com/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    Hi, the form on this page isn’t working either (http://staging3.pacelink.com/777-2/). You have some errors on your page. Could you try to resolve these first? The plugin will not work in most cases if there are javascript errors.

    Thread Starter crossbeats

    (@crossbeats)

    I’d made an error on the form – the form on that page (http://staging3.pacelink.com/777-2/) is working now!

    The only errors I see in the developer’s console are 2 fonts being blocked due to cross origin resource sharing. Are you getting other errors? If so, would you mind grabbing a screenshot?

    Plugin Author Jules Colle

    (@jules-colle)

    Okay, it is working now. I get 2 other errors, but no Javascript relates errors, so that should be okay.

    FYI there are the 2 other errors:

    GET http://pacelink.localhost.com/wp-content/uploads/sites/18/2016/10/chat.png net::ERR_NAME_NOT_RESOLVED
    (index):580
    
    GET http://pacelink.localhost.com/wp-content/uploads/sites/18/2016/10/feedback.png net::ERR_NAME_NOT_RESOLVED
    Plugin Author Jules Colle

    (@jules-colle)

    by the way, I don’t see the feedback tab you are talking about on the home page..

    Thread Starter crossbeats

    (@crossbeats)

    It’s set to fade in on a 500px scroll – roughly once you’re past the large slider image(s).

    View post on imgur.com

    • This reply was modified 9 years, 1 month ago by crossbeats.
    Plugin Author Jules Colle

    (@jules-colle)

    Oh I see, so did you just copy the html code? Because it will not work like that. The proper way to include a CF7 form directly in your theme is described here:

    https://contactform7.com/faq/can-i-embed-a-contact-form-into-my-template-file/

    Thread Starter crossbeats

    (@crossbeats)

    Yep, that’s what I’ve got:

    <div id="slideout" class="scrollFade">
    <img src="http://pacelink.localhost.com/wp-content/uploads/sites/18/2016/10/feedback.png" alt="Feedback" />
    <div id="slideout_inner">
        <?php echo do_shortcode( '[contact-form-7 id="776" title="Dealer Feedback"]' ); ?>
    </div>
    </div>
    Plugin Author Jules Colle

    (@jules-colle)

    alright i will check why it isn’t working.

    Plugin Author Jules Colle

    (@jules-colle)

    I have tested this on a couple of my own sites and it works without flaw.

    By looking at your source code I noticed that the conditional fields javascript file isn’t loaded. This could be caused by a couple of reasons. Could you please check the following?

    – do you call wp_footer() in your footer.php file and is footer.php included in all your template files?
    – are you using a caching plugin? If so try temporarily disabling it or clearing the cache.
    – I noticed there are over 100 scripts loaded, most of them are loaded trough invalid markup. (Check source code with firefox to see all the lines marked in red)

    Because it looks like you are using a modified version of a very VERY complex theme (Avada) I would suggest you to try and reproduce the problem on a clean install on wordpress, and gradually try to add the plugins and theme you are using in order to find out what could be causing the breakdown. There are just too many variables to look at at the moment. I can assure you that including the shortcode in all themes I tested work fine. (example: all the default twentysomething themes)

    Thread Starter crossbeats

    (@crossbeats)

    I’ve disabled all plugins except for the Contact Form 7 Plugin and Conditional Fields plugin – and switched to the twentyseventeen theme. The Conditional field still isn’t working with the shortcode in the theme.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Conditional Fields Don’t Work When Embedding Form in Template’ is closed to new replies.