Skip Navigation

[Resolved] What's the difference between Checkbox and Checkboxes custom types?

This support ticket is created 6 years, 11 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.

Our next available supporter will start replying to tickets in about 2.30 hours from now. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 5 replies, has 2 voices.

Last updated by Nigel 6 years, 11 months ago.

Assisted by: Nigel.

Author
Posts
#598760

Dear Toolset,

I've found your website very difficult to find any information even for a simple question. For example, I could not seem to find anything anywhere on the site that explains the difference between Checkbox and Checkboxes custom types.

Where can I find it?

Is there a way to search your documentation?

For each question I have, I have to spend a lot of time going through all the links on your site and reading so many irrelevant search results of the forums. I've spent a lot more time searching for info than actually building my site.

How do people learn using Toolset?

frustrated 🙁

#598807

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Screen Shot 2017-12-14 at 08.33.54.png

Hi Chris

I'm sorry for your frustrations with the documentation. I've advocated improving its organisation before and will add this thread as feedback in support.

What is it about the difference between checkbox fields and checkboxes fields you find confusing?

A checkbox field is a binary choice, much like a radio button field, checked or not checked, set or not set. It is stored in the database as a simple string according to the settings you choose when creating the field.

A checkboxes field has more in common with the multi-select field and is like the category selector on a post edit screen (see screenshot). A user can choose as many or as few options as they like. Checkboxes are complex and stored in the database field as an array in a proprietary format understood only by Types (and the rest of the Toolset plugins). So you can't easily import data from an external source as checkboxes fields, for example.

Is there some aspect of using the fields in practice you need clarifying?

#599074

Hi Nigel,

Thanks for your explanation.

I'm not sure if I understand completely. What would be a good example of using the checkbox and checkboxes fields? How would you know if you want to use one field instead of the other?

Let's say I have the following case for my directory site:

I want my members to be able to list their services by selecting checkboxes:

--------------------------------------------
Please select services you offer:

[ ] Service A
[ ] Service B
[ ] Service C
...
--------------------------------------------

For each checkbox they select above, another set of checkboxes for sub-services will appear underneath it for them to select from:

--------------------------------------------
Please select services you offer:

[x] Service A
......... [ ] Sub-Service 1
......... [ ] Sub-Service 2
......... [ ] Sub-Service 3
[ ] Service B
[ ] Service C
...
--------------------------------------------

For the scenario above, which field should I use, checkbox or checkboxes field?

Thank you very much.

#599331

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

The answer here largely depends on what you intend to do with this data once it has been entered, if you can elaborate on that.

And it is not clear from your example above whether the selections are mutually exclusive or not. Can a user Service A and Service B, or is it a question of one or the other?

#599441

Hi Nigel,

Thanks for your reply.

Let's say one of my members selects the following services by checking the checkboxes next to their names. The selected checkboxes are displayed below with an X inside them, e.g. [X]:
--------------------------------------------
Please select services you offer:

[X] Service A
......... [ ] Sub-Service 1
......... [X] Sub-Service 2
......... [ ] Sub-Service 3
[ ] Service B
[X] Service C
......... [X] Sub-Service 1
......... [ ] Sub-Service 2
......... [X] Sub-Service 3
...
--------------------------------------------

I would then like to display on the front-end (on member's single-post page or search results) the services this member is offering based on their selected checkboxes above. So the frontend should look like this:

--------------------------------------------
Services offered:

1. Service A (Sub-Service 2)
2. Service C (Sub-Service 1, Sub-Service 3)

--------------------------------------------

So the data from the checkboxes will be used in search and in displaying the services offered on the search results and member's single-post page.

The checkbox selections are not mutually exclusive. Members can select as many or as few checkboxes as they wish, or nothing at all.

With the scenario above, which custom field do you think I should use, checkbox or checkboxes field?

I hope I answered your questions. Please let me know if you have any other question.

Thanks.

#599743

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi Chris

Thanks for elaborating your needs.

Actually, what you are describing sounds more like a hierarchical taxonomy (like categories for standard WordPress posts).

The checkboxes custom field would allow users to make multiple optional selections, stored in a single custom field, but is not hierarchical, and would not allow you to present sub-services.

The checkbox field is not relevant here, you would be creating a new custom field for every option, and if you wanted to include them in search you would have to add filters for each field individually.

Creating a custom hierarchical taxonomy should meet your needs.

https://toolset.com/documentation/user-guides/create-custom-taxonomies/