Solved

How to show and hide table row on radio button list selection?

Posted on 2009-05-16
5
980 Views
Last Modified: 2012-05-07
I have a .net radio list control and table row with a dropdown box in it on my web form.
Within the RB list I have 4 selections, (A,B,C,D) how can I hide the table row and dropdown box  until C is selected and then rehide it if the user selects one of the other 3 options?
0
Comment
Question by:ITHelper80
  • 3
  • 2
5 Comments
 
LVL 41

Accepted Solution

by:
HonorGod earned 500 total points
ID: 24406657
Something like this perhaps?
<html>

<head>

<title> HideRow </title>

<script type='text/javascript'>

  function checkit( obj ) {

    var here = document.getElementById( 'here' )

    here.style.display = ( obj.id == 'C' ) ? '' : 'none'

  }

</script>

</head>

<body>

<table border='1'>

  <tr>

    <td>A</td>

  </tr>

  <tr>

    <td>B</td>

  </tr>

  <tr id='here'>

    <td>C</td>

  </tr>

  <tr>

    <td>D</td>

  </tr>

</table>

<table>

  <tr>

    <td>A<input type='radio' id='A' name='ABCD' onclick='checkit(this)'/></td>

    <td>B<input type='radio' id='B' name='ABCD' onclick='checkit(this)'/></td>

    <td>C<input type='radio' id='C' name='ABCD' onclick='checkit(this)'/></td>

    <td>D<input type='radio' id='D' name='ABCD' onclick='checkit(this)'/></td>

  </tr>

</table>
 

</body>

</html>

Open in new window

0
 
LVL 6

Author Comment

by:ITHelper80
ID: 24411191
Thanks for the help, do you know how to make this working with a .Net radio button control?
0
 
LVL 6

Author Comment

by:ITHelper80
ID: 24411257
I am getting an error saying object expected when I click on the asp.net raido list...
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24411261
No, unfortunately I nave no experience with .Net.  Sorry.

Perhaps you could "Request Assistance" with this question, and change the zone.
0
 
LVL 41

Expert Comment

by:HonorGod
ID: 24444459
Thanks for the grade & points.

Sorry I didn't have a .Net specific answer for you.

Good luck & have a great day.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn how to count occurrences of each item in an array.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now