title: id.style.display not working
body: <p>Not sure why this isn't working. There is no js error, but it just doesn't set the display property to "block". If I remove the inner most if statement, the display property for the div control is changed when the last radio button is selected from the group.</p>
  
  <p>.aspx file</p>
  
  <pre><code>&lt;asp:RadioButtonList ID="rblMarital" RepeatDirection="Horizontal" runat="server"&gt;
      &lt;asp:ListItem Value="S" Selected="True"&gt;Single&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="M"&gt;Married&lt;/asp:ListItem&gt;
      &lt;asp:ListItem Value="D"&gt;Separated/Divorced&lt;/asp:ListItem&gt;
  &lt;/asp:RadioButtonList&gt;
  </code></pre>
  
  <p>codebehind</p>
  
  <pre><code>If controlId = "rblMarital" Then
      str = "M"
  End If
  
  rbl = wizard.FindControl(controlId)
  div = wizard.FindControl(temp)
  rbl.Attributes.Add("onClick", "showHide('" &amp; rbl.UniqueID &amp; "','" &amp; div.ClientID &amp; "','" &amp; str &amp; "')")
  </code></pre>
  
  <p>javascript</p>
  
  <pre><code>function showHide(rbl, div, str) {
  
      var rblID = document.getElementsByName(rbl);
      var divID = document.getElementById(div);
  
      for (var j = 0; j &lt; rblID.length; j++) {
          if (rblID[j].checked) {
              if (rblID[j].value == str) {
                  divID.style.display = "block";
              }
          }
      else
          divID.style.display = "none";
      }
  }
  </code></pre>
  
  <p>rendered output</p>
  
  <pre><code>&lt;td&gt;Marital Status:&lt;/td&gt;
  &lt;td&gt;
      &lt;table class="noPad formRadioButton"&gt;
          &lt;tr&gt;
              &lt;td&gt;
                  &lt;table id="_ctl0_ContentPlaceHolder1_wizard1_rblMarital" onClick="showHide('_ctl0:ContentPlaceHolder1:wizard1:rblMarital','_ctl0_ContentPlaceHolder1_wizard1_divMarital','M')" border="0"&gt;
                  &lt;tr&gt;
              &lt;td&gt;&lt;input id="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_0" type="radio" name="_ctl0:ContentPlaceHolder1:wizard1:rblMarital" value="S" checked="checked" /&gt;&lt;label for="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_0"&gt;Single&lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input id="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_1" type="radio" name="_ctl0:ContentPlaceHolder1:wizard1:rblMarital" value="M" /&gt;&lt;label for="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_1"&gt;Married&lt;/label&gt;&lt;/td&gt;
                          &lt;td&gt;&lt;input id="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_2" type="radio" name="_ctl0:ContentPlaceHolder1:wizard1:rblMarital" value="D" /&gt;&lt;label for="_ctl0_ContentPlaceHolder1_wizard1_rblMarital_2"&gt;Separated/Divorced&lt;/label&gt;&lt;/td&gt;
          &lt;/tr&gt;
          &lt;/table&gt;
              &lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td colspan="2"&gt;
          &lt;div id="_ctl0_ContentPlaceHolder1_wizard1_divMarital" style="display:none;"&gt;
              &lt;table class="noPad"&gt;
                  &lt;tr&gt;
                      &lt;td class="back660000"&gt;If your spouse is a student&lt;/td&gt;
                      &lt;td align="center" style="width:250px;"&gt;School &lt;input name="_ctl0:ContentPlaceHolder1:wizard1:txtSpouseSchool" type="text" id="_ctl0_ContentPlaceHolder1_wizard1_txtSpouseSchool" style="width:180px;" /&gt;&lt;/td&gt;
                      &lt;td style="width:180px"&gt;Graduation year &lt;input name="_ctl0:ContentPlaceHolder1:wizard1:txtSpouseGrad" type="text" maxlength="4" id="_ctl0_ContentPlaceHolder1_wizard1_txtSpouseGrad" style="width:30px;" /&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td class="back660000"&gt;Is your spouse employed&lt;/td&gt;
                      &lt;td colspan="2"&gt;
                          &lt;table class="formRadioButton"&gt;
                              &lt;tr&gt;
                                  &lt;td&gt;
                                      &lt;span id="_ctl0_ContentPlaceHolder1_wizard1_rblSpouseEmployed"&gt;&lt;input id="_ctl0_ContentPlaceHolder1_wizard1_rblSpouseEmployed_0" type="radio" name="_ctl0:ContentPlaceHolder1:wizard1:rblSpouseEmployed" value="No" /&gt;&lt;label for="_ctl0_ContentPlaceHolder1_wizard1_rblSpouseEmployed_0"&gt;No&lt;/label&gt;&lt;input id="_ctl0_ContentPlaceHolder1_wizard1_rblSpouseEmployed_1" type="radio" name="_ctl0:ContentPlaceHolder1:wizard1:rblSpouseEmployed" value="Yes" checked="checked" /&gt;&lt;label for="_ctl0_ContentPlaceHolder1_wizard1_rblSpouseEmployed_1"&gt;Yes&lt;/label&gt;&lt;/span&gt;
                                  &lt;/td&gt;
                                  &lt;td&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Annual income &lt;input name="_ctl0:ContentPlaceHolder1:wizard1:txtSpouseIncome" type="text" id="_ctl0_ContentPlaceHolder1_wizard1_txtSpouseIncome" style="width:100px;" /&gt;
                                  &lt;/td&gt;
                              &lt;/tr&gt;
                          &lt;/table&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>