yubrajs Posted April 22, 2023 Posted April 22, 2023 How do I add a check box field in newsletter form.
KatjaScalia Posted August 13 Posted August 13 On 4/22/2023 at 7:39 PM, yubrajs said: How do I add a check box field in newsletter form. I'm looking for a solution, too and hope @tuanphan can help...
tuanphan Posted August 15 Posted August 15 (edited) On 8/13/2024 at 4:44 PM, KatjaScalia said: I'm looking for a solution, too and hope @tuanphan can help... Use this code to Code Injection > Footer <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.0/jquery.min.js"></script> <script> $(document).ready(function () { var newsLetterForm = $(".newsletter-form-body")[0]; $(newsLetterForm).find(".newsletter-form-fields-wrapper").after('<input id="checkbox-form" type="checkbox">') var buttonSubmit = $(newsLetterForm).find("button") if($(this).is(':checked')){ buttonSubmit.removeClass("disableButton") } else { buttonSubmit.addClass("disableButton") } $("#checkbox-form").change(function() { if($(this).is(':checked')){ buttonSubmit.removeClass("disableButton") } else { buttonSubmit.addClass("disableButton") } }); }); </script> <style> .sqs-block-newsletter .newsletter-form-button.disableButton { background-color: gray!important; pointer-events: none; } </style> Edited August 15 by tuanphan Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment