0

Just needed to add a popup modal when the checkbox is ticked and post the values to the controller.

1 Answer 1

0

this is the code which open the popup modal on the view button click you can change it according to your checkbox.

<div id="modal" >
    <div class="modal-body-content">
    Pop up Stuff
    </div>
</div>

<button id="button">
    <span><?= $block->escapeHtml(__('View')) ?></span>
</button>

    <script>
        require([
            'jquery',
            'Magento_Ui/js/modal/modal'
        ], function($, modal) {

            var options = {
                type: 'popup',
                responsive: true,
                title: 'Pop Up Title',
                buttons: [{
                    text: $.mage.__('Close'),
                    class: '',
                    click: function() {
                        this.closeModal();
                    }
                }]
            };
    
            var popup = modal(options, $('#modal'));
            $("#button").click(function() {
                $('#modal').modal('openModal');
            });
        });
    </script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.