Business Rules is such a great module, kudos to its creator and contributors. I have used it in several scenarios.

However, I am kind of stuck somewhere.

Suppose I have field C which is a list of colleges names and it is dependent upon the values of two different fields i.e A and B? let suppose field A is the state where colleges reside, and B is the gender of college students.

So if I have selected New York in field A, and I choose Male in field B, I should be provided with a list of schools names in field C that are in New York and of type Male

How do I do this?

Comments

isalmanhaider created an issue. See original summary.

isalmanhaider’s picture

I somehow achieved it through Ajax callback on fields and altering options of the select list, it served the purpose and I am getting perfect options on the form exactly as I wanted with correct labels and ids but now when I submit the form I get this error "An illegal choice has been detected. Please contact the site administrator"

I know that is because the form that was built and posted to the page had different options, now I have altered them with ajax. (which can be bypassed by commenting its condition check in FormValidator.php under ⁨core⁩ ▸ ⁨lib⁩ ▸ ⁨Drupal⁩ ▸ ⁨Core⁩ ▸ ⁨Form⁩) but that can certainly lead to security implications on all forms that reside on the website, like if someone tries to edit options keys from inspect element.

Now the question is how to resolve this with the best optimal solution?

colan’s picture

Component: Code » Dependent fields
isalmanhaider’s picture

Any update/fix for this?