• Resolved rabox66

    (@rabox66)


    After Updating to the newest version the checkboxes do not work anymore. WP, theme and all plugins are using the newest version, also deactivating all other plugins did not change it.

    After downgrading CF7 to 5.9 the checkboxes worked again. It looks like a bug in 6.0. Could you please fix it?

    Thanks

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi @rabox66 , your problem description is not very specific about what exactly does not work anymore.
    I am affected by a checkbox/radio button problem that might be a problem for you, too:
    https://ww.wp.xz.cn/support/topic/swv-enum-rule-fails-for-checkboxes-radio-buttons-with-surrounding-whitespace/
    So if you are using whitespace surrounding your radio buttons or checkbox values, then I recommend to follow this support request.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where can we see the website in question?

    Thread Starter rabox66

    (@rabox66)

    Hi ,support team.
    Unfortunately, I’m unable to provide a link to the bug, as the issue needed to be resolved urgently. I managed to fix it by downgrading to CF7 version 5.9. Here you can see the form, but the bug is not visible in the moment: https://dr-tauber.de/kontakt/

    However, I’ll describe the bug in detail:

    1. I was using a required checkbox field.
    2. I tried multiple ways to embed it, as there was a linked description included, which made the setup a bit tricky. Even the simplest setup (e.g., adding a checkbox shortcode followed by a <p> tag containing text and a link) failed.
    3. In all cases, clicking the checkbox immediately triggered the red validation warning.
    4. After downgrading to CF7 5.9, the issue was resolved.

    I hope this description helps. While I can’t upgrade the live site to reproduce the bug, I’m happy to assist in any other way. If needed, I can create a staging site, though I’d prefer alternative solutions if possible.

    Please let me know how you’d like to proceed.

    Thanks very much,
    Raphael

    Try using the following code on pages with forms (requires jQuery – if $ is undefined, replace with jQuery):

    $('.wpcf7 input[type="checkbox"]').on('change', function(e) {
    e.stopPropagation();
    });
    Thread Starter rabox66

    (@rabox66)

    Hi Gal Baras,
    thank you for that idea. I can try that jQuery, that looks intersting. But what I do not understand, that is, that there is a problem after a major update and nobody reacts. The plugin worked perfectly on 5.9 and on 6.0 it does not.
    Thanks
    Raphael

    Thread Starter rabox66

    (@rabox66)

    Hi Gal,
    I had a deeper look at your code. Unfortunately it does not help. My problem is, that the chackbox itself does not work anymore. As soon as I am using a checkbox CF7 does not work anymore. It is not after changing the checkbox. It is always.

    I don’t see my code on your site. When I add the following code in the brower console, validation is no longer triggered on your page when the checkbox is checked or unchecked.

    jQuery('.wpcf7 input[type="checkbox"]').on('change', function(e) {
    e.stopPropagation();
    });

    Try this, because it can work even when $ is undefined.

    Disclaimer: I haven’t tried submitting the form, only checking/unchecking the box.

    there is a problem after a major update and nobody reacts

    This problem has been there long before the recent update, and several people have reported it, but for some reason, @takayukister shoots it down as a “wontfix”.

    Hi,
    I had the same problem after upgrading from version 5.9.8 to 6.0 yesterday (the value of the checkbox does not change to true in the background, even though the tick has appeared).
    Today I rolled back to 5.9.8 and the checkbox works again (I don’t want to put extra jQuery codes on all our forms so far, it didn’t work for me anyway. Where would it have been worth putting it?).
    Please investigate the real reason and fix it.
    Thanks

    @mzozoo This topic has been marked as resolved, so I guess no developer will look for it.
    One reason behind it could be a different (imo inconsistent) validation method in 5.9 vs 6.0.
    The problem described here https://ww.wp.xz.cn/support/topic/swv-enum-rule-fails-for-checkboxes-radio-buttons-with-surrounding-whitespace/ might affect other values that include HTML markup like <p> or HTML code like &nbsp;

    @mzozoo You can translate the code into standard JavaScript. Here’s what Google Gemine suggested (untested):

    document.querySelectorAll('.wpcf7 input[type="checkbox"]').forEach(checkbox => {
    checkbox.addEventListener('change', (e) => {
    e.stopPropagation();
    });
    });

    You can put this in your theme’s functions.php as an action or in the theme’s script file, and I see no reason for it not to work, assuming you’re faced with the same situation.

    @martinw2 The plugin author has ignored this problem for a while now (not sure why), and this thread is marked as resolved presumabely because the OP’s site now works.

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

The topic ‘Problems with Checkboxes after Update’ is closed to new replies.