This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
It is sorta covered in the JavaRanch Style Guide.
subject: Dynamic message
Similar Threads
Struts 1.x, 2, jstl questions
struts tag problem ?
using ajax and struts iterate tags
bean:write tag - query
two forms on one jsp.