• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Dynamic message

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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";
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic