Home › Forums › General Issues › How to hide a checkbox that\'s in a fexible content box but not hide others › Reply To: How to hide a checkbox that\'s in a fexible content box but not hide others
This is what I’ve done so far. What this does is it adds the class .current to the selected checkbox and hide the rest. The problem I have now is that when you uncheck the box, the class .current is still there and when you check on another checkbox, it doesn’t work at all.
$(document).on("click", "#three_img_plus_feature_img input", function () {
$("#three_img_plus_feature_img").removeClass('current');
$(this).closest("#three_img_plus_feature_img").addClass('current');
if ($(this).is(":checked")) {
$("#three_img_plus_feature_img:not(.current) label").css("display", "none");
} else {
$("#three_img_plus_feature_img:not(.current) label").css("display", "block");
}
});
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.