Skip Navigation

[Resolved] styling checkbox labels

This support ticket is created 5 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by jonathanB-19 5 years, 8 months ago.

Assisted by: Minesh.

Author
Posts
#1213432
Screen Shot 2019-03-12 at 3.47.03 PM.png

I am trying to style the labels on my checkboxes with css. I found a variety of support tickets where people were able to do this with input[type="checkbox"] + label but this isn't working for me. I believe it's because the input is nested inside the label so CSS won't select the parent element.

Please see attached screenshot as the site is not live. I want to style the blue boxes when the label is checked.

#1213558

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - do you mean you want to highlight the whole box when checkbox is checked?

Can I see where those checkboxes added - Can you please share the link of that page?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#1213676
Screen Shot 2019-03-13 at 7.41.51 AM.png

I took the construction page down temporarily so you can see it here: hidden link

I want to do something similar to what they did here: https://toolset.com/forums/topic/style-checkboxes/

I can't get the :checked selector to apply to the label, and I can't modify the input to have a :before or :after. So I can change the size of the checkbox, or hide it, but I can't really style anything else. The goal is to have it look like the attached screenshot. Blue when checked and blue outline when not checked.

#1213718

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - the customize the checkboxes as per your requirement require a good knowledge of CSS and javascript.

This needs custom programming which is beyond the scope of our support policy. If you need custom programming for your project, please feel free to contact our certified partners:
=> https://toolset.com/contractors/

However - I can show you an alternative way if you would like to try it which I suggested to another user.

you should try to add your filters normally to your "Search and pagination" section and save the view and load the view on the frontend.
- Then, you should copy the rendered HTML for your checkboxes filter field from the view source and copy that HTML to your "Search and Pagination" section and remove the filter field you added using the shortcodes [wpv-control-postmeta].

Now, you have HTML for your filter field within the "Search and Pagination" section and you can customize its looks as per your need.

See the related ticket:
=> https://toolset.com/forums/topic/customizing-checkboxes-on-wpv-control-postmeta/#post-1207016

#1213793

I've determined that there isn't a way to solve the problem with CSS because of the way that the inputs are nested inside the labels, but I was able to solve it with some pretty simple jQuery. Thanks.