Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Struts 2 »

Re: [OT] How to dinamically load a <select> field

Christopher Schultz

2007-03-07

Replies:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

C??lio,

C??lio Cidral Junior wrote:
> [W]hat I need is to load a <select> field based on the value
> selected on another <select> field. Let's say you have a State field
> and also a City field. The user selects a state and the cities of that
> state are loaded in the City field. What's the best way to do that
> without having a page refresh?

You will need to use javascript to do this without a page refresh.
Unless you want to put every city from every state onto your page,
you'll need to use AJAX to request a list of cities from your server
when the state changes. Using that list, you'll have to empty the
current city list and re-populate it with the new list of cities.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF7viJ9CaO5/Lv0PARArBgAKC7JiJOK3rlRMlCVWPHbnnqdxMe2QCgsuq+
V4GrsGrxh5BpxhDCXLXePLQ=
=NpOc
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.