Common problem... What is the best solution?

B

bigbob

Assume you have a page that has the following three drop down lists

List_Of_States (Contains 50 States)
List_Of_Counties (Contains a list of counties in the selected state)
List_Of_Cities (Contains a list of cities/towns in the selected
county)

The list of states is static.
The entire list of counties would be fairly small (~20 counties per state =
~1000 counties)
This translates to ~15K-20K of text/XML and could be in a hidden field
on the page.
Note: I think that's too big, but the question is hypothetical anyway.
The entire list of cities is too large to transmit and a trip to the
server would always be required.

Object of the game:
When the user selects a state (e.g. Idaho)
Replace (for example)
<SELECT NAME="List_Of_Counties" >
<OPTION > ADAMS
<OPTION> BAKER
<OPTION> KING
<OPTION> LEWIS
</SELECT>

with (for example)

<SELECT NAME="List_Of_Counties" >
<OPTION > KITSAP
<OPTION> MASON
<OPTION> PIERCE
<OPTION> ZULU
</SELECT>

Finally, force the browser to render the resultant stream.

A similar function would be needed to replace <SELECT NAME="List_Of_Cities">

Obviously, I can do this via ASP, but that means doing a postback every time
the user clicks a dropdown.
Moreover, a page might contain any number of data driven objects, and I only
want to reload one of them.
ASP caching strategies seem to be largely ineffective in solving the
problem.
Is there a java applet (or a commercial product) that can do what I want to
do? I'm an
experienced programmer, but I've never jumped into the java pool.
The state/county/city page discussed above is not important, nor am I
building
such a page. What I'm looking for is a general purpose way to
replace a control (and its contents) on a page. Any advice would be
appreciated.
email:
(e-mail address removed)
 
C

Cowboy \(Gregory A Beamer\)

You can do this with arrays in JavaScript and keep everything on the client.
With a few choices, this is not a problem. If you have a wide matrix of
choices, you are better to postback.

The general method is to set up the arrays at the top of the page and change
the array for the next control in line by calling a JavaScript routine
onClick or a similar event.

--
Gregory A. Beamer
MPV; MCP: +I, SE, SD, DBA

**********************************************************************
Think outside the box!
**********************************************************************
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top