• Resolved marcus22

    (@marcus22)


    Hi,

    I’m currently having an issue with unchecking checkboxes with some jQuery using the following code:

    jQuery(document).on(‘click’, ‘[id*=”fieldname197_”]’, function(){
    jQuery(‘[class*=”discount-33″]’).prop(“disabled”, false);
    jQuery(‘[class*=”discount-50″]’).prop(“disabled”, true);
    jQuery(‘[class*=”discount-33″]:checked’).prop(“checked”, false);
    jQuery(‘[class*=”discount-50″]:checked’).prop(“checked”, false);
    })

    When I click on the button (fieldname197) it does untick the relevant checkboxes (which have a single option/value) but the value is still being called in a calculated field. When I manually untick the checkbox the value does not apply.

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @marcus22

    If the class names: discount-33 and discount-50 are assigned to fields in the form, a field is composed of multiple components: the label, the input field and the instructions for users, so, the correct would be something similar to:

    
    jQuery(document).on('click', '[id*="fieldname197_"]', function () {
        jQuery('[class*="discount-33"] input').prop("disabled", false);
        jQuery('[class*="discount-50"] input').prop("disabled", true);
        jQuery('[class*="discount-33"] input:checked').prop("checked", false);
        jQuery('[class*="discount-50"] input:checked').prop("checked", false);
    });
    

    Please, for additional questions, indicate the URL to the page where the form is inserted for checking it in action.

    Best regards.

    Thread Starter marcus22

    (@marcus22)

    Thanks for the quick reply!

    Afraid that didn’t work, I’ve actually inserted those classes via jQuery.

    Do you have an email I could send you a link on?

    Plugin Author codepeople

    (@codepeople)

    Hello @marcus22

    You can contact me directly through my private website: https://cff.dwbooster.com/contact-us

    Best regards.

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

The topic ‘Resetting Checkboxes’ is closed to new replies.