[FX.php List] A better way of making a Conditional Value List ?

David Ness dness at bondedbuilders.com
Fri Dec 5 13:52:32 MST 2008


Yes, exactly. A change in popup1 will call a javascript function using
the onChange event handler. This called function will "build" the popup2
menu.

Like I said, you can even do this without AJAX ix you don't mind
populating the Javascript array with ALL the potential values of popup2
during the initial page load, plus of course a key field probably equal
to the values in popup1 (although I can think of reasons that values in
the array might appear for multiple values of popup1 which would
necessitate a little more complexity... not much).

Only if the array would be too large or slow to load would you then take
it to the next level: using AJAX to retrieve the subset of array values
once you know the value in popup1.

I'll bet there are examples of how to build popup2 using Javascript and
a javascript array out on the web. I'll do some quick looking, although
I'll be outta here in about 10 minutes for our company party.

 
David Allen Ness
Database Systems Programmer
Web Applications Developer
 
 

-----Original Message-----
From: fx.php_list-bounces at mail.iviking.org
[mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of Dale Bengston
Sent: Friday, December 05, 2008 3:41 PM
To: FX.php Discussion List
Subject: Re: [FX.php List] A better way of making a Conditional Value
List ?

Also, this can all be triggered by an onchange JavaScript handler  
attached to popup1 rather than a submit button.
Dale

On Dec 5, 2008, at 1:10 PM, David Ness wrote:

> The answer will be AJAX unless the number of values for value list "2"
> aren't way too numerous... you can read V-L "2" values into a  
> JavaScript
> array and then build the 2nd options list using the onChange  
> attached to
> the first.
>
>
> David Allen Ness
> Database Systems Programmer
> Web Applications Developer
>
>
>
> -----Original Message-----
> From: fx.php_list-bounces at mail.iviking.org
> [mailto:fx.php_list-bounces at mail.iviking.org] On Behalf Of  
> william.downs
> Sent: Friday, December 05, 2008 1:55 PM
> To: FX.php Discussion List
> Subject: [FX.php List] A better way of making a Conditional Value  
> List ?
>
> Hi There FX.php ers,
>
> This may end up off-list - which if so then please excuse me.
>
> I mocked up a conditional value list in FX.php - but it really looks
> very bad.
>
> Basically, after selecting a value from Value List 1, I need a Submit
> button to post the form and populate the values for Value List 2.
> Terrible I know - in fact utterly atrocious !
>
> The possible values for Value List 2 are simply too many to pick up
> the first time.
>
> There is of course a Value List 3, dependent on Value List 2 - which
> would need a second Submit button - (taking the michy really)
>
> Can someone show me the better way - I am already assuming that the
> answer will have something to do with Javascript / Ajax (via an
> Onchange event) - but I can live in hope that I am wrong.
>
> Kindest Regards
>
> William
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list