[thelist] Stupid JS trick

Michael Buffington mike at price.com
Wed Aug 8 19:59:48 CDT 2001


I have no doubt that this topic has been extensively covered, but after an
hour or two of searching I've swallowed my pride and am now taking it to the
list.

I have a form, with several select elements. The select elements are
populated by individual ColdFusion queries (which probably isn't that
relevant).

I need the select elements to show dynamic values based on the selections of
the other select elements, using JavaScript to avoid a refresh.

So if the user selects CA in select box 1, select box 2 should only show
cities unique to california. It also needs to go the other direction - if
the user leaves select box 1 blank, but selects a city, the state for that
city should be selected.

I understand that giving each select element the ability to be a child or a
parent could get pretty complex, and that strict parent/child relationships
are simpler. I'm having a difficult time with both, so I'll take what I can
get.

If anyone has any examples or how-to's I'd really appreciate it.

Michael Buffington
http://www.michaelbuffington.com
mike at stompzine.com
cell. (714) 404-8616
home. (949) 457-2247




More information about the thelist mailing list