Re: [Jason] Displaying selected list content based on other selected list content
Oh, nice trick with that pseudo field. It's gotten me much closer.
My next step is to take each carrier and make a list under it of the plans that each carrier has. For example:
Carriers: Aetna, Aflac, Blue Cross, Vytra
Aetna Plans: HMO, PPO, POS
Aflac Plans: Network
Blue Cross Plans: Family Care, PPO
Vytra Plans: HMO, POS
The doctor accepts Vytra's POS plan, Aetna's PPO and POS plans, and nothing else.
So, on the page, I would do the following if I was using HTML:
Aetna:
<ul>
<li>PPO</li>
<li>POS</li>
</ul>
Vytra:
<ul>
<li>POS</li>
</ul>
In the CMS, I have given the user the ability to select Aetna and Vytra from one checkbox list. Then, they scroll down to the Aetna list and select PPO and POS. Then they scroll down to the Vytra list and select POS.
I'm getting closer to my goal, but not quite there. The demo link has been updated. This is what I have now:
<?php foreach ($find_a_doctorRecord['insurance_carriers:labels'] as $carrier):?>
<?php echo $carrier; ?><ul><li>
<?php foreach ($find_a_doctorRecord['insurance_carriers:values'] as $plan):?>
<?php echo join('</li><li>', $find_a_doctorRecord[$plan]); ?></li></ul>
<?php endforeach ?>
<?php endforeach ?>
I know there is an issue with the inner foreach loop. I'm looking at it now, and I know it's wrong, and I know why it's wrong (I'm cycling through the same list twice), but I'm not quite sure where to go next.
Thank you again!
-----
~Jessica Sullivan, Crystal Realm Designs.