Hi
my name is frank and I try to experiment checkbox control by checkbox. it looks working but I need help with display, appearance. using bs3 at moment, the bs3 checkbox “template” from w3schools ‘falls apart’ at display after applying my idea. I don’t understand why. please help me to get a well formatted display, thank you.
the quotation marks are missing but I disabled them because I found it a duplicate statement. apart from that I’ve done checking with w3 validator and it looks ok but the appearance might be a bit redundant. please have a look, thank you.
thank you for answer. I just need to double check the code. I would like use it in registration form. also button and label looks redundant by content. is it ok or there is a solution for ‘all in one’ option.thank you.
If I knew what you were trying to achieve it would help
It looks from the demo that you are enabling and disabling some checkboxes when you click the first checkbox. However its not clear what you want or expect to happen. If the revealed inputs are checked and then you click to disable them they are not reset but just disabled. I’m not sure whether that’s a good idea as it may look like they have been chosen because they are still checked although disabled.
The code looks ugly and the html is non semantic as you seem to have replaced labels with buttons which is not very good for accessibility.
The clearer you can define your objectives the easier it will be to help. There is however a lot of duplication in that code anyway and if you are expanding the number of items the approach you are using would not be viable. You would probably need to add a convenient classnames to all the elements that need to be switched on and off and then cycle through them in js rather than naming each and every single one of them in your js.
thank you for help. the reason of having this approach is , as you noticed, to enable/disable checkboxes. if someone doesn’t want them it is easier to disable them . yes I noticed disabling them it does not affect weather is checked or not so with disabling also I need uncheck or reset too. also convenient classes would be more helpful. but the problem is button label matter. can I use them parallel, side by side? can label be empty, not to repeat information regarding checkboxes? thank you.
ps I am thinking about making somehow label clickable, button like. I was thinking about divs also.thank you.
thank you for help. this is what I would like, it is relay nice, thank you.
ps my reasons for button type label are smaller mobile devices where we can operate easier with fingers. thank you.
ps also I forgot can I style button type label as buttons ? thank you