Jump to content

checkboxes in field dependencies


sab
 Share

Recommended Posts

Hi everyone,

I could have asked the following question in a wrong place. So, I decided to ask here as well. I have two fields in the admin: the second one's values change depending on the first one's chosen value. I wonder if there is any way to change the selectbox type of the dependant field into checkboxes so I can see all the options of the list of subcategories straight away without any extra action. Thanks in advance!

***********************

  On 11/30/2013 at 7:52 PM, ryan said:

Actually, you can do this on the dev branch. Lets assume that cities are children of countries and that is reflected in your page structure (i.e. /countries/france/paris/). Create your 2 page fields (country and city), and configure 'country' as a single page field with "parent" set to "/countries/". Next, for the "city" field configuration, use the "Custom selector to find selectable pages", present on the "input" tab. In that field, enter "parent=page.country". Save and try it out. This works with select, selectMultiple and asmSelect fields (and possibly others), though not yet with checkboxes, radios or PageListSelect. 

This works perfectly! BUT, still doesn't work with checkboxes. Is there any way to make this method to work with checkboxes or radiobuttons?

Thanks!

Link to comment
Share on other sites

Do you want to develop something on your own?

Do you want to hire someone that develops it for you?

Do you want to ask @kongondo if it is possible to add that feature to his module when you purchase it?

What are your skills?

What is your level of experience with processwire?

What is your timeframe?

What amount of options do you have (thousands of options or just a few)?

etc.


---

The more information you provide, the better the answers will be.

Edit: Sorry, didn't read the quoted message carefully enough. But still some more information will help in providing better answers ?

  • Like 1
Link to comment
Share on other sites

I'm a beginner, so I don't really think I can do it by myself. Based on your response, I take it that it's not provided as a built-in option and it requires lots of effort or there's a commercial module. Hmm, in that case, I think I'm just okay with the current possibility with the selectbox and keep learning about processwire as much as I can as there is no urgent timeframe. Thank you for your time, Bernhard! ?

Edit: Not really thousands of, but dozens of options max.

I'm striving to create a small e-commerce website for myself. And thought, checking subcategories would be easier on the eyes than selecting them.

  • Like 1
Link to comment
Share on other sites

You're welcome,

I don't know of a quick built in way, but sometimes it's easy to solve such things with little hacks - especially when you are not dealing with huge amounts of data. Can you provide an example of values that are in the first pagefield and that would be in the second.

Like ryan did in his example: Country / City

What kind of data do you have? Are the values of the checkboxes dynamic or do you set them manually?

Link to comment
Share on other sites

It's almost identical to that of Ryan's examples. I have main categories like health, food etc. And under the Health, for instance, there are subcategories such as Fasting and so on. I have all of those main and sub categories as pages and the subcategories are nested inside individual respective main categories. Therefore, the values of the checkboxes are predefined manually.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...