Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

html:select

 
Jherald Lacambra
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new to struts and i want to know how to populate the html:select from data. I have to html:select. The values of the second select must depends on the first html:select

ex.

The values of the first options of the html:select are:
color
shape
size
If i choose shape, the options for the second html:select must be
round,oval,square,etc.

And if i choose size the options of the second must be
small,medium,large

I think javascript cannot solve this bacause i am polpulating the html:select from database.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you're looking for help specifically with Struts, you should go to the Struts forum...

But this question really deals more with design of application flow rather than Struts directly - there are several choices you could make, depending on your application -

  • Send all possible information for all choices to the client and do JavaScript manipulation of the forms as choices are made.
  • Restucture your application so that what is currently one form is spread across 3 real forms, save data in session on the server until all forms are filled in.
  • Use AJAX - make a background request to the server using JavaScript when the button is pressed to make a quick request to the server to get the new information. (Visit the HTML/JavaScript forum here on JavaRanch for more information about AJAX...)

  •  
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic