Select radio button

I am trying to get it so that if a user wants to select certian questions they can check the checkbox next to the question and then at the bottom of the form there is a button called mark no, this will mark the radio buttons for the questions that have been checked to the selection no. I have tried to get it so that on the button click it will mark all of the checkbox’s to no but i can’t seem to get that to work. I am fairly new to javascript, any help is appreciated thanks.

At the risk of sounding slow I’m not entirely sure what you are trying to do.

You have a set of radio buttons as well as a conventional button. A variety of radio buttons will be optionally chosen and the conventional button (when toggled) will toggle the look of the each of the selected radio buttons. Is that the look you are going for or am I missing something?

floater

Close but i am not trying to change the look, I have a conventional button that when clicked will mark all radio buttons with a given name attribute.

The code below is what i have in a function, when the conventional button is clicked the onClick event calls this function. form1 is the name of my form and selection is the name i gave my radio buttons with the value of NO.


document.form1.selection.checked = true;

Does this make more sense? Thanks for the help.

Does it make sense?..

I guess but it does not surprise me that it is not working the way you want it to. In your code javascript will treat “selection” in

document.form1.selection.checked = true;

as a variable (which I’m guessing is not defined)

Here is some example code that I threw together:

<html>
<head>
<title>Radio Test</title>
<script type="text/javascript">
function checkradio() {
    var radiogroup = document.forms["radioform"]["r1"];
    var radiovalue = 0;
    for (var i = 0; i < radiogroup.length; i++) {
        if (radiogroup[i].checked == true)
        {
          radiovalue = radiogroup[i].value;
        }
  }
  var noshow=document.getElementById("notshown");
  noshow.value=radiovalue;
  alert("the value of the hidden form element is: "+noshow.value);  
}
</script> 
</head>

<body>
<form id="radioform">

    <input id="radio1" type="radio" name="r1" value="Yes" />Yes
    <br/>
    <input id="radio2" type="radio" name="r1" value="Absolutely Not" />No
    <br/>
    <input id="notshown" type="hidden" name="sum" value="" />

    <input id="submit" type="submit" value="Submit" />
</form>
<script type="text/javascript">
  var submit = document.getElementById("submit");
  submit.onclick = checkradio;
</script>  
</html>    

Anyway, I hope that it helps and if you still have questions please feel free.

happy New Year!

floater

I will play around with your code…Thanks for the help and Happy New Year!

Actually we need to see your html (form structure). So can you post your whole HTML so that we can see and write some lines for you?

Here is my entire code including my javascript file.


<html>
<head>
<title>Questions</title>
<style type="text/css">
	font.numbers{
		font-size: 22px;
		font-weight: bold;
	}

	li{
		list-style-type: none;
		position: left;
		float:left;
	}

</style>
<script type="text/javascript" src="questions.js"></script>
</head>

<body>
<h1>Questions</h1>
<form name="form1" method="get" >
<p><font class="numbers">2.</font> Question</p>
<div id="expand1" style="display:none">
<p>Question Expanded</p>
<p>note</p>
</div>
<input type="button" class="expand" onclick="return expand('expand1')" value="Expand"></input>
<hr>

<table border="1">
<tr id="row_1">
<td><input type="checkbox" name="check_1" onclick="SelectRow(1)"/></td>
<td><p><font class="numbers">&nbsp 2a.</font>question</p>
<div id="expand2" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand2')" value="Expand"></input>
<ul>
<li><input type="radio" value="n" name="selection1"  id="select1" />NO</li>
<li><input type="radio" value="y" name="selection2"  id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection3"  id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection4"  id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_2">
<td><input type="checkbox" name="check_2" onclick="SelectRow(2)"/></td>
<td><p class="ordered"><font class="numbers">&nbsp 2b.</font><b>(i)</b>question</p>
<div id="expand3" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand3')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection1" id="select1"/>NO</li>
<li><input type="radio" value="y" name="selection2" id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection3" id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection4" id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_3">
<td><input type="checkbox" name="check_3" onclick="SelectRow(3)"/></td>
<td><p><b class="test">(ii)</b>question</p>
<div id="expand4" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand4')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" id="select1"/>NO</li>
<li><input type="radio" value="y" name="selection" id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection" id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection" id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_4">
<td><input type="checkbox" name="check_4" onclick="SelectRow(4)"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand5" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand5')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_5">
<td><input type="checkbox" name="check-5" onclick="SelectRow(5)"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand6" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand6')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="check_6" onclick="SelectRow(6)"/></td>
<td><p><font class="numbers">2c.</font> <b>(i)</b>question</p>
<div id="expand7" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand7')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="check_7" onclick="SelectRow(7)"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand8" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand8')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c3"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand9" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand9')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>


<tr>
<td><input type="checkbox" name="2c4"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand10" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand10')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c5"/></td>
<td><p><b>(v)</b>question</p>
<div id="expand11" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand11')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>


<tr>
<td><input type="checkbox" name="2c6"/></td>
<td><p><b>(vi)</b>question</p>
<div id="expand12" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand12')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c7"/></td>
<td><p><b>(vii)</b>question</p>
<div id="expand13" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand13')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c8"/></td>
<td><p><b>(viii)</b>question</p>
<div id="expand14" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand14')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2d"/></td>
<td><p><font class="numbers">2d.</font>question</p>
<div id="expand15" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand15')" value="Expand" />
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2e"/></td>
<td><p><font class="numbers">2e.</font>question</p>
<div id="expand16" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand16')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2f"/></td>
<td><p><font class="numbers">2f.</font>question</p>
<div id="expand17" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand17')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2g"/></td>
<td><p><font class="numbers">2g.</font>question</p>
<div id="expand18" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand18')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2h"/></td>
<td><p><font class="numbers">2h.</font>question</p>
<div id="expand19" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand19')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2i"/></td>
<td><p><font class="numbers">2i.</font>question</p>
<div id="expand20" style="display:none">
<p>question</p>
</div>
<input type="button" class="expand" onclick="return expand('expand20')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j"/></td>
<td><p><font class="numbers">2j.</font> <b>(i)</b>question</p>
<div id="expand21" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand21')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j2"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand22" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand22')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j3"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand23" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand23')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2k"/></td>
<td><p><font class="numbers">2k.</font>question</p>
<div id="expand24" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand24')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2l"/></td>
<td><p><font class="numbers">2l.</font>question</p>
<div id="expand25" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand25')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2m"/></td>
<td><p><font class="numbers">2m.</font>question</p>
<div id="expand26" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand26')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2n"/></td>
<td><p><font class="numbers">2n.</font>question</p>
<div id="expand27" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand27')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2o"/></td>
<td><p><font class="numbers">2o.</font>question expanded</p>
<div id="expand28" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand28')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p"/></td>
<td><p><font class="numbers">2p.</font>question</p>
<div id="expand29" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand29')" value="Expand"/>

<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p2"/></td>
<td><p><b>(ii)</b> question</p>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p3"/></td>
<td><p><b>(iii)</b> question</p>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p4"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand30" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand30')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p5"/></td>
<td><p><b>(v)</b>question</p>
<div id="expand31" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand31')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2q"/></td>
<td><p><font class="numbers">2q.</font>question</p>
<div id="expand32" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand32')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2q2"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand33" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand33')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2r"/></td>
<td><p><font class="numbers">2r.</font>question</p>
<div id="expand34" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand34')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2s"/></td>
<td><p><font class="numbers">2s.</font>question</p>
<div id="expand35" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand35')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>
<tr>
<td><input type="checkbox" name="2t"/></td>
<td><p><font class="numbers">2t.</font>question</p>
<div id="expand36" style="display:none">
<p>question</p>
</div>
<input type="button" class="expand" onclick="return expand('expand36')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection" />NO</li>
<li><input type="radio" value="y" name="selection" />YES</li>
<li><input type="radio" value="b" name="selection" />BOTH</li>
<li><input type="radio" value="d" name="selection" />D-Blanks</li>
</ul>
</td>
</tr>

</table>

<p>note</p>

<input type="submit" value="submit" name="submit" disabled="true"/>

<input type="button" value="Mark No" onclick="setCheckedValue(document.forms['form1'].elements['select'], 'n');"/>
<input type="text" size="40" id="txtSelectedValues"/>
<input type="button" value="Mark check" onclick="test1();"
</form>
</body>
</html>

javascript file


//function works
function expand(x){
	var y=document.getElementById(x);
	if(!y) {
		return true;
	}
	if(y.style.display=="none"){
		y.style.display="block"
	}else {
		y.style.display="none"
	}
	return true;
}

//function needs to be modified

/*function Reset() {
  				// Get a reference to the text box
  				var txtSelectedValuesObj = document.getElementById('txtSelectedValues');

  				// Loop through the rows and clear the background and check boxes
  				for (i=1; i<=numRows; i++) {
					// Get a reference to the current row
					var row=document.getElementById('row_'+i);
					row.style.background=deselectedColor;
					document.getElementById('check_'+i).checked=false;
  				}
  				// Clear the text box
  				txtSelectedValuesObj.value="";
			}*/





//Test Functions

/* test() function sort of works*/
function test(){
	for(i=0; i<getElementById("select1").length; i++){		
		document.getElementById("select1")[i].checked = true;
	}
}

/*************************************************************************/

function test1(){
	document.form1.selection1.checked=true;

}

Thanks for All the Help.

You can’t do that. All the radio buttons in a given group MUST have the same name (since that’s how the group is identified) and only ONE radio button in a group can be selected at any one time.

Would this work if i changed the names for each radio group as shown in my code. I am not sure how i would get the javascript to work though…thanks for the help.


<html>
<head>
<title>Questions</title>
<style type="text/css">
	font.numbers{
		font-size: 22px;
		font-weight: bold;
	}

	li{
		list-style-type: none;
		position: left;
		float:left;
	}

</style>
<script type="text/javascript" src="questions.js"></script>
</head>

<body>
<h1>Questions</h1>
<form name="form1" method="get" >
<p><font class="numbers">2.</font> Question</p>
<div id="expand1" style="display:none">
<p>Question Expanded</p>
<p>note</p>
</div>
<input type="button" class="expand" onclick="return expand('expand1')" value="Expand"></input>
<hr>

<table border="1">
<tr id="row_1">
<td><input type="checkbox" name="check_1" onclick="SelectRow(1)"/></td>
<td><p><font class="numbers">&nbsp 2a.</font>question</p>
<div id="expand2" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand2')" value="Expand"></input>
<ul>
<li><input type="radio" value="n" name="selection1"  id="select1" />NO</li>
<li><input type="radio" value="y" name="selection1"  id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection1"  id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection1"  id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_2">
<td><input type="checkbox" name="check_2" onclick="SelectRow(2)"/></td>
<td><p class="ordered"><font class="numbers">&nbsp 2b.</font><b>(i)</b>question</p>
<div id="expand3" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand3')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection2" id="select1"/>NO</li>
<li><input type="radio" value="y" name="selection2" id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection2" id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection2" id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_3">
<td><input type="checkbox" name="check_3" onclick="SelectRow(3)"/></td>
<td><p><b class="test">(ii)</b>question</p>
<div id="expand4" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand4')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection3" id="select1"/>NO</li>
<li><input type="radio" value="y" name="selection3" id="select2"/>YES</li>
<li><input type="radio" value="b" name="selection3" id="select3"/>BOTH</li>
<li><input type="radio" value="d" name="selection3" id="select4"/>D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_4">
<td><input type="checkbox" name="check_4" onclick="SelectRow(4)"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand5" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand5')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection4" />NO</li>
<li><input type="radio" value="y" name="selection4" />YES</li>
<li><input type="radio" value="b" name="selection4" />BOTH</li>
<li><input type="radio" value="d" name="selection4" />D-Blanks</li>
</ul>
</td>
</tr>

<tr id="row_5">
<td><input type="checkbox" name="check-5" onclick="SelectRow(5)"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand6" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand6')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection4" />NO</li>
<li><input type="radio" value="y" name="selection4" />YES</li>
<li><input type="radio" value="b" name="selection4" />BOTH</li>
<li><input type="radio" value="d" name="selection4" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="check_6" onclick="SelectRow(6)"/></td>
<td><p><font class="numbers">2c.</font> <b>(i)</b>question</p>
<div id="expand7" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand7')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection5" />NO</li>
<li><input type="radio" value="y" name="selection5" />YES</li>
<li><input type="radio" value="b" name="selection5" />BOTH</li>
<li><input type="radio" value="d" name="selection5" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="check_7" onclick="SelectRow(7)"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand8" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand8')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection6" />NO</li>
<li><input type="radio" value="y" name="selection6" />YES</li>
<li><input type="radio" value="b" name="selection6" />BOTH</li>
<li><input type="radio" value="d" name="selection6" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c3"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand9" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand9')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection6" />NO</li>
<li><input type="radio" value="y" name="selection6" />YES</li>
<li><input type="radio" value="b" name="selection6" />BOTH</li>
<li><input type="radio" value="d" name="selection6" />D-Blanks</li>
</ul>
</td>
</tr>


<tr>
<td><input type="checkbox" name="2c4"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand10" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand10')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection7" />NO</li>
<li><input type="radio" value="y" name="selection7" />YES</li>
<li><input type="radio" value="b" name="selection7" />BOTH</li>
<li><input type="radio" value="d" name="selection7" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c5"/></td>
<td><p><b>(v)</b>question</p>
<div id="expand11" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand11')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection8" />NO</li>
<li><input type="radio" value="y" name="selection8" />YES</li>
<li><input type="radio" value="b" name="selection8" />BOTH</li>
<li><input type="radio" value="d" name="selection8" />D-Blanks</li>
</ul>
</td>
</tr>


<tr>
<td><input type="checkbox" name="2c6"/></td>
<td><p><b>(vi)</b>question</p>
<div id="expand12" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand12')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection9" />NO</li>
<li><input type="radio" value="y" name="selection9" />YES</li>
<li><input type="radio" value="b" name="selection9" />BOTH</li>
<li><input type="radio" value="d" name="selection9" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c7"/></td>
<td><p><b>(vii)</b>question</p>
<div id="expand13" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand13')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection10" />NO</li>
<li><input type="radio" value="y" name="selection10" />YES</li>
<li><input type="radio" value="b" name="selection10" />BOTH</li>
<li><input type="radio" value="d" name="selection10" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2c8"/></td>
<td><p><b>(viii)</b>question</p>
<div id="expand14" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand14')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection11" />NO</li>
<li><input type="radio" value="y" name="selection11" />YES</li>
<li><input type="radio" value="b" name="selection11" />BOTH</li>
<li><input type="radio" value="d" name="selection11" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2d"/></td>
<td><p><font class="numbers">2d.</font>question</p>
<div id="expand15" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand15')" value="Expand" />
<ul>
<li><input type="radio" value="n" name="selection12" />NO</li>
<li><input type="radio" value="y" name="selection12" />YES</li>
<li><input type="radio" value="b" name="selection12" />BOTH</li>
<li><input type="radio" value="d" name="selection12" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2e"/></td>
<td><p><font class="numbers">2e.</font>question</p>
<div id="expand16" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand16')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection13" />NO</li>
<li><input type="radio" value="y" name="selection13" />YES</li>
<li><input type="radio" value="b" name="selection13" />BOTH</li>
<li><input type="radio" value="d" name="selection13" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2f"/></td>
<td><p><font class="numbers">2f.</font>question</p>
<div id="expand17" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand17')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection14" />NO</li>
<li><input type="radio" value="y" name="selection14" />YES</li>
<li><input type="radio" value="b" name="selection14" />BOTH</li>
<li><input type="radio" value="d" name="selection14" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2g"/></td>
<td><p><font class="numbers">2g.</font>question</p>
<div id="expand18" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand18')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection15" />NO</li>
<li><input type="radio" value="y" name="selection15" />YES</li>
<li><input type="radio" value="b" name="selection15" />BOTH</li>
<li><input type="radio" value="d" name="selection15" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2h"/></td>
<td><p><font class="numbers">2h.</font>question</p>
<div id="expand19" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand19')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection16" />NO</li>
<li><input type="radio" value="y" name="selection16" />YES</li>
<li><input type="radio" value="b" name="selection16" />BOTH</li>
<li><input type="radio" value="d" name="selection16" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2i"/></td>
<td><p><font class="numbers">2i.</font>question</p>
<div id="expand20" style="display:none">
<p>question</p>
</div>
<input type="button" class="expand" onclick="return expand('expand20')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection17" />NO</li>
<li><input type="radio" value="y" name="selection17" />YES</li>
<li><input type="radio" value="b" name="selection17" />BOTH</li>
<li><input type="radio" value="d" name="selection17" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j"/></td>
<td><p><font class="numbers">2j.</font> <b>(i)</b>question</p>
<div id="expand21" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand21')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection18" />NO</li>
<li><input type="radio" value="y" name="selection18" />YES</li>
<li><input type="radio" value="b" name="selection18" />BOTH</li>
<li><input type="radio" value="d" name="selection18" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j2"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand22" style="display:none">
<p> question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand22')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection19" />NO</li>
<li><input type="radio" value="y" name="selection19" />YES</li>
<li><input type="radio" value="b" name="selection19" />BOTH</li>
<li><input type="radio" value="d" name="selection19" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2j3"/></td>
<td><p><b>(iii)</b>question</p>
<div id="expand23" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand23')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection20" />NO</li>
<li><input type="radio" value="y" name="selection20" />YES</li>
<li><input type="radio" value="b" name="selection20" />BOTH</li>
<li><input type="radio" value="d" name="selection20" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2k"/></td>
<td><p><font class="numbers">2k.</font>question</p>
<div id="expand24" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand24')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection21" />NO</li>
<li><input type="radio" value="y" name="selection21" />YES</li>
<li><input type="radio" value="b" name="selection21" />BOTH</li>
<li><input type="radio" value="d" name="selection21" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2l"/></td>
<td><p><font class="numbers">2l.</font>question</p>
<div id="expand25" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand25')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection22" />NO</li>
<li><input type="radio" value="y" name="selection22" />YES</li>
<li><input type="radio" value="b" name="selection22" />BOTH</li>
<li><input type="radio" value="d" name="selection22" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2m"/></td>
<td><p><font class="numbers">2m.</font>question</p>
<div id="expand26" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand26')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection23" />NO</li>
<li><input type="radio" value="y" name="selection23" />YES</li>
<li><input type="radio" value="b" name="selection23" />BOTH</li>
<li><input type="radio" value="d" name="selection23" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2n"/></td>
<td><p><font class="numbers">2n.</font>question</p>
<div id="expand27" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand27')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection24" />NO</li>
<li><input type="radio" value="y" name="selection24" />YES</li>
<li><input type="radio" value="b" name="selection24" />BOTH</li>
<li><input type="radio" value="d" name="selection24" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2o"/></td>
<td><p><font class="numbers">2o.</font>question expanded</p>
<div id="expand28" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand28')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection25" />NO</li>
<li><input type="radio" value="y" name="selection25" />YES</li>
<li><input type="radio" value="b" name="selection25" />BOTH</li>
<li><input type="radio" value="d" name="selection25" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p"/></td>
<td><p><font class="numbers">2p.</font>question</p>
<div id="expand29" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand29')" value="Expand"/>

<ul>
<li><input type="radio" value="n" name="selection26" />NO</li>
<li><input type="radio" value="y" name="selection26" />YES</li>
<li><input type="radio" value="b" name="selection26" />BOTH</li>
<li><input type="radio" value="d" name="selection26" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p2"/></td>
<td><p><b>(ii)</b> question</p>
<ul>
<li><input type="radio" value="n" name="selection27" />NO</li>
<li><input type="radio" value="y" name="selection27" />YES</li>
<li><input type="radio" value="b" name="selection27" />BOTH</li>
<li><input type="radio" value="d" name="selection27" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p3"/></td>
<td><p><b>(iii)</b> question</p>
<ul>
<li><input type="radio" value="n" name="selection28" />NO</li>
<li><input type="radio" value="y" name="selection28" />YES</li>
<li><input type="radio" value="b" name="selection28" />BOTH</li>
<li><input type="radio" value="d" name="selection28" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p4"/></td>
<td><p><b>(iv)</b>question</p>
<div id="expand30" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand30')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection29" />NO</li>
<li><input type="radio" value="y" name="selection29" />YES</li>
<li><input type="radio" value="b" name="selection29" />BOTH</li>
<li><input type="radio" value="d" name="selection29" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2p5"/></td>
<td><p><b>(v)</b>question</p>
<div id="expand31" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand31')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection30" />NO</li>
<li><input type="radio" value="y" name="selection30" />YES</li>
<li><input type="radio" value="b" name="selection30" />BOTH</li>
<li><input type="radio" value="d" name="selection30" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2q"/></td>
<td><p><font class="numbers">2q.</font>question</p>
<div id="expand32" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand32')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection31" />NO</li>
<li><input type="radio" value="y" name="selection31" />YES</li>
<li><input type="radio" value="b" name="selection31" />BOTH</li>
<li><input type="radio" value="d" name="selection31" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2q2"/></td>
<td><p><b>(ii)</b>question</p>
<div id="expand33" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand33')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection32" />NO</li>
<li><input type="radio" value="y" name="selection32" />YES</li>
<li><input type="radio" value="b" name="selection32" />BOTH</li>
<li><input type="radio" value="d" name="selection32" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2r"/></td>
<td><p><font class="numbers">2r.</font>question</p>
<div id="expand34" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand34')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection33" />NO</li>
<li><input type="radio" value="y" name="selection33" />YES</li>
<li><input type="radio" value="b" name="selection33" />BOTH</li>
<li><input type="radio" value="d" name="selection33" />D-Blanks</li>
</ul>
</td>
</tr>

<tr>
<td><input type="checkbox" name="2s"/></td>
<td><p><font class="numbers">2s.</font>question</p>
<div id="expand35" style="display:none">
<p>question expanded</p>
</div>
<input type="button" class="expand" onclick="return expand('expand35')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection34" />NO</li>
<li><input type="radio" value="y" name="selection34" />YES</li>
<li><input type="radio" value="b" name="selection34" />BOTH</li>
<li><input type="radio" value="d" name="selection34" />D-Blanks</li>
</ul>
</td>
</tr>
<tr>
<td><input type="checkbox" name="2t"/></td>
<td><p><font class="numbers">2t.</font>question</p>
<div id="expand36" style="display:none">
<p>question</p>
</div>
<input type="button" class="expand" onclick="return expand('expand36')" value="Expand"/>
<ul>
<li><input type="radio" value="n" name="selection35" />NO</li>
<li><input type="radio" value="y" name="selection35" />YES</li>
<li><input type="radio" value="b" name="selection35" />BOTH</li>
<li><input type="radio" value="d" name="selection35" />D-Blanks</li>
</ul>
</td>
</tr>

</table>

<p>note</p>

<input type="submit" value="submit" name="submit" disabled="true"/>

<input type="button" value="Mark No" onclick="setCheckedValue(document.forms['form1'].elements['select'], 'n');"/>
<input type="text" size="40" id="txtSelectedValues"/>
<input type="button" value="Mark check" onclick="test1();"
</form>
</body>
</html>

new Javascript code


var numRows=37;
var selectedColor='#999'; //Color row will be when selected
var deselectedColor='FFF'; // Color row will be when deselected

function expand(x){
	var y=document.getElementById(x);
	if(!y) {
		return true;
	}
	if(y.style.display=="none"){
		y.style.display="block"
	}else {
		y.style.display="none"
	}
	return true;
}

function Reset() {
				
  				// Get a reference to the text box
  				var txtSelectedValuesObj = document.getElementById('txtSelectedValues');

  				// Loop through the rows and clear the background and check boxes
  				for (i=1; i<=numRows; i++) {
					// Get a reference to the current row
					var row=document.getElementById('row_'+i);
					document.getElementById('check_'+i).checked=false;
  				}
  				// Clear the text box
  				//txtSelectedValuesObj.value="";
			}
			
function SelectRow(newRow) {
				// Get a reference to the current row
				var row=document.getElementById('row_'+newRow);


				/*
					Determine if the row is selected.
						If it is, change the background color and check the checkbox
						If it is not, reset the background color, and uncheck the checkbox
				*/
 				if (row.style.background.toUpperCase()==selectedColor) {
 					row.style.background=deselectedColor;
 					document.getElementById('check_'+newRow).checked=false;
   				} else {
 					row.style.background=selectedColor;
					document.getElementById('check_'+newRow).checked=true;
   				}

   				// Call to test function
   				//displaySelected();
			}
			
/*function displaySelected() {
  				// Get a reference to the text box
  				var txtSelectedValuesObj = document.getElementById('txtSelectedValues');
				// Instantiate the array
  				var selectedArray = new Array();
  				// Instantiate the array pointer
  				var count=1;

				// Loop through the rows, if selected, add them to the array
  				for (i=1; i<=numRows; i++) {
					// Get a reference to the current row
					var row=document.getElementById('row_'+i);
    				if (row.style.background.toUpperCase()==selectedColor) {
      					selectedArray[count] = document.getElementById('check_'+i).value;
      					count++;
    				}
  				}
  				// Assign the array to the text box
  				txtSelectedValuesObj.value = selectedArray;
			}*/