Hi, Fabio

Thanks for the tip. Unfortunately it is not going to
work for me. I don't have the list of all possible
options for the second box until the selection in
first bos is made. I need to get them from the
database after I know which country was selected. 

However I found the answer in Struts users archive - I
have to use Javascript to detect choices in the first
select list and submit the form from this script. In
the Action that receives the form, I will check the
value of a hidden variable to see if this submit is
for the redisplaying the same jsp with newly populated
second box or this is a final "submit". If this is for
redisplaying - Action gets the data for the second box
from the database and forwards back to the same jsp
with updated values.

Regards
Olga

--- Fábio_Silva <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I had the same problem, but I didn't manage to solve
> it using only struts.
> 
> Nevertheless, I found an interesting Javascript
> chunk of code that 
> solved my problem:
> 
> Go to:
> 
>
http://www.mattkruse.com/javascript/dynamicoptionlist/
> 
> If you have problems adapting this to struts, please
> tell me. I can 
> arrange for a code example.
> 
> Hope this helps,
> Fábio
> 
> 
> Olga Agady wrote:
> > Hello,
> > 
> > In my html:form I have two select boxes: one with
> the
> > list of the countries and another one with the
> list of
> > states in a country. When the user selects a
> country I
> > have to populate the select box with the states
> for
> > this country. The list of states I get from the
> > database. Could someone recommend me the way how I
> can
> > do this dynamically? I can write a javascript
> (which
> > will be called when the user selects the country)
> to
> > populate the state select box, but how can I get
> the
> > list of the states in this script from the
> database?
> > Is there any possibility to dynamically get data
> into
> > javascript from the database? Or there is another
> way
> > to implement those two select boxes? 
> > 
> > Please help.
> > 
> > Thanks 
> > Olga
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > HotJobs - Search Thousands of New Jobs
> > http://www.hotjobs.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to