bootbox icon indicating copy to clipboard operation
bootbox copied to clipboard

Checkbox can't select

Open JasonLiuLab opened this issue 7 years ago • 6 comments

Hi,

I use the latest bootbox.all.min.js, and the bootstrap is 3.3.7, and jquery is 3.2.1 , But i can't select the checkbox, can you help me ?

checkbox

JasonLiuLab avatar Aug 04 '19 13:08 JasonLiuLab

bootbox.prompt({
                        title: "This is a prompt with a set of checkbox inputs!",
                        value: ['1', '3'],
                        inputType: 'checkbox',
                        inputOptions: [{
                                text: 'Choice One',
                                value: '1',
                            },
                            {
                                text: 'Choice Two',
                                value: '2',
                            },
                            {
                                text: 'Choice Three',
                                value: '3',
                            }],
                        callback: function (result) {
                            console.log(result);
                        }
                    });

This the method to call the alert like the example you gived.

JasonLiuLab avatar Aug 04 '19 13:08 JasonLiuLab

I can't reproduce this. Fiddle, with Bootstrap 3.3.7 and Bootbox 5.2.0 (5.3 is just an update to the repo structure): https://jsfiddle.net/v405qts7/

Generally speaking, you'll see this sort of behavior if the for attribute of your labels are duplicated (they all point to one ID) or are invalid (there is no element with a matching ID). If you can, use the developer tools to copy the HTML generated for the dialog and post it here.

tiesont avatar Aug 04 '19 19:08 tiesont

OK, let me try update bootstrap to 5.2.0, I will give you a feedback.

Much Thanks.

JasonLiuLab avatar Aug 05 '19 03:08 JasonLiuLab

There isn't a Bootstrap 5.2. Did you mean Bootbox?

tiesont avatar Aug 05 '19 03:08 tiesont

Sorry, I got it wrong. And i uploaded the code here, can you help me when you are free? https://jsfiddle.net/zt742hea/

Much Thanks!

JasonLiuLab avatar Aug 05 '19 13:08 JasonLiuLab

Thank you very much, I found the root cause. The style of the checkbox in my css file conflicts with the checkbox.

JasonLiuLab avatar Aug 06 '19 12:08 JasonLiuLab