update select with servlet

F

f

I have two SELECTs in a html page. One is "State", such as CA, NV, NY,
FL.... Another is "City", the cities in that State. Once a user
selects the "State" in the first SELECT, I would like to update the
second SELECT to display only cities in that state. I would like to
use servlet to find cities for one state. How can I wirte this html
page?

Thanks,

ff
 
B

Bryce (Work)

I have two SELECTs in a html page. One is "State", such as CA, NV, NY,
FL.... Another is "City", the cities in that State. Once a user
selects the "State" in the first SELECT, I would like to update the
second SELECT to display only cities in that state. I would like to
use servlet to find cities for one state. How can I wirte this html
page?

You can use javascript I suppose.
 
A

Andrew Thompson

....
You can use javascript I suppose.

Is this form of input better suited to
a wizard? If the user only enters a single
chunk of the information per page, it
becomes easy to alter subsequent pages
with the relevant info.

[ But please do not do what some U.S. based
web page did to me the other day. After
choosing a country that was _not_ the
U.S., it sill only presented U.S. states
...so obviously I selected 'The Yukon
Territory' or something similar. ;-) ]

BTW - that claim of mine about 'easiest
as wizard' might be hotly disputed at
one group you did not post to, so I'll
point it out now..
<http://www.physci.org/codes/javafaq.jsp#cljg>

In fact, f'ups set to c.l.j.g. I think
that is where this qn will get the best
answers, since this is ultimately a matter
of how the user interacts with your api
through it's interface.
 
M

Michael Scovetta

If you have only a limited (read: small) number of total cities, then
you can do it with JavaScript. Just make a bunch of the drop-downs,
hide
most of them, and hide/display them using the
style.display=['none'|'block']. I would assume that you'll have more
than a few hundred cities, in which case you either wizard-it-up with
multiple pages or load the cities using a hidden iframe. I would vote
for a wizard, getting the iframe code to work is a pain, and it tends
to be fragile and not very browser independent.

My $0.02.

Michael Scovetta
 

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

No members online now.

Forum statistics

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

Latest Threads

Top