[Solar-talk] Hieriarchal Selects

Kilbride, James P. James.Kilbride at gd-ais.com
Tue Dec 4 06:22:29 CST 2007


Actually no. What I mean is dependent selects.

With the pear quick forms it was possible to set a series of hierarchal
selects. Basically you have 2 select boxes. The first has your primary
option say:

Car
Truck

The second has nothing in it until one option is choosen in the first
one. If Car is choosen the second one has the options:
Sedan
Coupe
Station Wagon

If Truck is choosen then it becomes:
2x4
4x4
Extended Cab

This was done via javascript I believe in quick_form. This ability for
hierarchal selects that are based on previous answers is extremely
useful. Can this be done with solar? In quickform it was done with this
code:

     $sel =& $displayActivity->addElement('hierselect','Activity',null);
     $sel->setMainOptions($area_select);
     $sel->setSecOptions($activity_select); 

James Kilbride 

-----Original Message-----
From: solar-talk-bounces at lists.solarphp.com
[mailto:solar-talk-bounces at lists.solarphp.com] On Behalf Of Paul M Jones
Sent: Monday, December 03, 2007 9:07 PM
To: solar-talk at lists.solarphp.com
Subject: Re: [Solar-talk] Hieriarchal Selects


On 03 Dec 2007, at 20:05, Kilbride, James P. wrote:

> Did anybody have any answers to this?
>
> From: solar-talk-bounces at lists.solarphp.com 
> [mailto:solar-talk-bounces at lists.solarphp.com
> ] On Behalf Of Kilbride, James P.
> Sent: Wednesday, November 28, 2007 4:28 PM
> To: solar-talk at lists.solarphp.com
> Subject: [Solar-talk] Hieriarchal Selects
>
> Is there some way to do hierarchal selects with solar forms? How do 
> you do them? A good example would be helpful.
>
Sorry about the delay.  Do you mean something like <optgroup> values
within the select options?  It's not currently supported by the
formSelect() helper, but I can see how we could add that in.  (Idea
would be to have it see if the option display is itself an array, and
use the key as the optgroup label instead of the option value ... hope
that makes sense.)


-- pmj
_______________________________________________
Solar-talk mailing list
Solar-talk at lists.solarphp.com
http://mailman-mail3.webfaction.com/listinfo/solar-talk



More information about the Solar-talk mailing list