File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Dynamic message Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic message " Watch "Dynamic message " New topic

Dynamic message

Achal Jalan

Joined: Nov 23, 2004
Posts: 21


In the code below,

Row1 of the table has a drop down menu
In row2 I need to display an appropriate msg depending on the choice the user made in row1.

Could you please advise me on the best way to go about it.

Any sample code would be very very helpful.

The code below is just a subsection of the actual jsp page, thus I need to be able to do this without going to the servlet.



The obove doesnt seem to work and gives me an error " 'result' object not found. "...

Thanks in advance for all the help
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
For each <tr> tag for your optional rows, add the following:

id="<<put descriptive name here>>" "style="visibility:hidden; display:none"

then add an onChange event to your html:select tag that calls a javaScript function. In that function, put logic that will display only the rows that need to be there based on what was selected. To redisplay a row, use something like this:


Consultant, Sima Solutions
I agree. Here's the link:
subject: Dynamic message
It's not a secret anymore!