Is it possible to construct a metabox, that has several options that are linked?
Say I have 3 selections to choose from, with several options:
Selection 1: A1, A2, A3, A4
Selection 2: B1, B2, B3, B4, B5
Selection 3: C1, C2, C3
Now, when I select A1 option, the only available options from two other selections are for instance B2, B4, B5 and C1. And so on, for various options.
The thing is that I can easily create those options, and then just put in a description saying what option can go with what other options. Say you selected A1 and B1, but B1 won’t work, so you shouldn’t select it, I can just write that down, but I think that’s not so user friendly, and people are sometimes lazy to read, so it’s just easier to limit out those options.
Can it be done? And how? HTML manipulating or within PHP with switch
or if-else-if
statements?
You need chained selections, here’s a simple example
And here’s an example using Ajax.