Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Posted on 2009-05-16
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?
Question by:ITHelper80
  • 3
  • 2
LVL 41

Accepted Solution

HonorGod earned 500 total points
ID: 24406657
Something like this perhaps?
<title> HideRow </title>
<script type='text/javascript'>
  function checkit( obj ) {
    var here = document.getElementById( 'here' )
    here.style.display = ( obj.id == 'C' ) ? '' : 'none'
<table border='1'>
  <tr id='here'>
    <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>

Open in new window


Author Comment

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

Author Comment

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

Expert Comment

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

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

Expert Comment

ID: 24444459
Thanks for the grade & points.

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

Good luck & have a great day.

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…

792 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