update select with servlet

Discussion in 'Java' started by f, Apr 7, 2004.

  1. f

    f Guest

    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
    f, Apr 7, 2004
    #1
    1. Advertising

  2. f

    Bryce (Work) Guest

    On 6 Apr 2004 22:15:01 -0700, (f) wrote:

    >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.

    --
    now with more cowbell
    Bryce (Work), Apr 7, 2004
    #2
    1. Advertising

  3. On Wed, 07 Apr 2004 10:16:43 -0400, Bryce (Work) wrote:

    >> 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.

    ....
    > 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.

    --
    Andrew Thompson
    http://www.PhySci.org/ Open-source software suite
    http://www.PhySci.org/codes/ Web & IT Help
    http://www.1point1C.org/ Science & Technology
    Andrew Thompson, Apr 7, 2004
    #3
  4. 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




    (f) wrote in message news:<>...
    > 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
    Michael Scovetta, Apr 7, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hartmut Schroth
    Replies:
    3
    Views:
    3,481
    Hartmut Schroth
    Dec 1, 2003
  2. Andy Fish
    Replies:
    4
    Views:
    2,392
    Andy Fish
    Dec 17, 2003
  3. Sean Clarke
    Replies:
    1
    Views:
    1,872
    Sudsy
    Jan 7, 2004
  4. circuit_breaker
    Replies:
    2
    Views:
    1,967
    Jack Jia
    Apr 4, 2004
  5. palmiere
    Replies:
    1
    Views:
    322
    Erwin Moller
    Feb 9, 2004
Loading...

Share This Page