• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic message

 
Achal Jalan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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";
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic