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

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?
LVL 6
ITHelper80Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
HonorGodConnect With a Mentor Commented:
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
 
ITHelper80Author Commented:
Thanks for the help, do you know how to make this working with a .Net radio button control?
0
 
ITHelper80Author Commented:
I am getting an error saying object expected when I click on the asp.net raido list...
0
 
HonorGodCommented:
No, unfortunately I nave no experience with .Net.  Sorry.

Perhaps you could "Request Assistance" with this question, and change the zone.
0
 
HonorGodCommented:
Thanks for the grade & points.

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

Good luck & have a great day.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.