• Resolved brianread

    (@brianread)


    My Conditional fields have just stopped working:

    https://englishcountrymusicweekend.org.uk/weekend-tickets/

    The top selector “Paypal” or “BACS” should show the selection next to it. Conditionals in the mail message also have stopped working:

    I am geting this now:

    [paypal]Payment by Paypal[/paypal]
    [BACS]Payment by BACS or cheque[/BACS]

    whereas on the 19th I got this:

    Payment by Paypal

    The page I need help with: [log in to see the link]

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

    (@jules-colle)

    the plugin’s scripts.js file is not loaded. The conditional fields scripts are called in the ‘wpcf7_enqueue_scripts’ action hook, which is native to Contact Form 7.

    This is also causing your plugin to not be validated by an ajax call, but your page is reloaded on submission. Is this something you did intentionally?

    The Conditional Fields plugin depends on the correct working of Contact Form 7, so the first step would be to disable the Conditional Fields plugin and try to fix the ajax submission in CF7. https://contactform7.com/why-isnt-my-ajax-contact-form-working-correctly/

    Thread Starter brianread

    (@brianread)

    I have looked at the template code and confirmed the wp_header() and wp_footer() and also validated the html.

    However I am using some of my own javascript as well, through a plugin which allows that. That might be the problem.

    What I am not clear about is why it worked until the update 3 days ago?

    As this form is live just now I can’t really play with it too much.

    Where can I find a zip of 1.4.3 so that i can restore the functionality and then later clone it and see if i can get to the bootom of it?

    Plugin Author Jules Colle

    (@jules-colle)

    You can download all previous versions from the Advanced tab: https://www.ads-software.com/plugins/cf7-conditional-fields/advanced/

    Scroll down and select the version you want.

    If the form works with the older version, could you let me know? I’d like to check why it works with version 1.4.3

    Thread Starter brianread

    (@brianread)

    yes, confirming that it “works” with 1.4.3.

    However I think your point above is also true – the ajax is not working for another reason.

    You can see it working at top of the form – selecting paypal or BACS results in the next column reflecting that choice, Wiht 1.5 it remained blank.

    Plugin Author Jules Colle

    (@jules-colle)

    I have a suspicion that somewhere in your theme or in a plugin or in your wp-config.php file you might be calling setting this:

    define('WPCF7_LOAD_JS', false);

    Can you check if this is the case? The simplest way to do this would probably be to edit your functions.php file and simply add this PHP code.

    echo WPCF7_LOAD_JS ? 'WPCF7_LOAD_JS is true' : 'WPCF7_LOAD_JS is false';

    Then refresh any page of your website and at the top it should say WPCF7_LOAD_JS is either true or false.

    Thread Starter brianread

    (@brianread)

    Yes, you are correct It does show that.

    I’ll download the complete tree and then go a grep across it all anbd see where the offending line is..

    Thread Starter brianread

    (@brianread)

    ok, found it, in the paypal addon for Contact &:

    ./plugins/contact-form-7-paypal-add-on-pro/includes/redirect_methods.php: define(‘WPCF7_LOAD_JS’, false);

    Thread Starter brianread

    (@brianread)

    ok, I’ve found that is is associated with sonmething in that plug called “Redirect Method” which if set to “Method 2” calls that false setting.

    I’ve checked that changing the redirect to “method 1” leaves the variable to true.

    Am now checking that the form still works properly using youjr version 1.4.3, and wil then update to 1.5 and try it again.

    Thread Starter brianread

    (@brianread)

    ok, confirming that with that change to Redirect method 1 in the paypal addition to Contact 7 your version 1.5 seems to work fine now.

    And it is clearly using ajax on the submit rather than refreshing the form now.

    Many thanks for the help.

    Plugin Author Jules Colle

    (@jules-colle)

    Thanks for your analysis and follow up. This is extremely helpful. I’m going to reconsider when the Conditional fields scripts needs to be loaded, as it looks like CF7 can work without it’s native scripts. So only loading the conditional fields scripts if the CF7 script is loaded, is probably not my best approach ??

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Conditoinal fields not working’ is closed to new replies.