This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Dynamic message " Watch "Dynamic message " New topic
Author

Dynamic message

Achal Jalan
Greenhorn

Joined: Nov 23, 2004
Posts: 21
Hi,

Hi,

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 JAVASCRIPT




THE RELEVEANT HTML




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

Thanks in advance for all the help
Achal
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:

document.getElementById("row1").style.visibility="visible";
document.getElementById("row1").style.display="inline";


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic message