mardi 6 octobre 2015

Radio Group doesn't unHide when Checkbox is selected

I am trying to unhide a group of radio buttons if the checkbox above it is checked and hide them when checkbox isn't checked. I had a previous version of this, in the same application, and it works just fine [radio button opens checkboxes instead] under Working one. When MinorCheck is selected the radio buttons don't become visible. No errors show, nothing happens. Why is this?

I have looked at other comments how Visible = "false" stops it and so forth. however, it is clear that visible="false" at the start isn't an issue for my first block of coding.

Working one:

HTML

<td class="LeftAlign" width="24%">                 

<font class="Blackfont" size="1">
<B>                                     Union Affiliated?
</B>
</font>
<font class="WeOrangefont" size="1">
&#8226;
</font>
</td>
    <td width="10%">
       <asp:RadioButtonList ID="rblclass" runat="server" AutoPostBack="True" class="Bluefont" size="1" font-Bold="True" font-Size="8pt" >

              <asp:ListItem Value="Y">Yes</asp:ListItem>
              <asp:ListItem Value="N">No</asp:ListItem>
       </asp:RadioButtonList>
     </td>

     <td></td>  
  </tr>
</table>

VB.NET

Protected Sub rblclass_SelectedIndexChanged(sender As Object, e As EventArgs) Handles rblclass.SelectedIndexChanged
    If (rblclass.SelectedValue = "Y") Then
        Register.Focus()
        union1.Visible = True
        union2.Visible = True
        union3.Visible = True
        LocalLbl.Visible = True
        Reqimage.Visible = True
    Else
        Register.Focus()
        union1.Visible = False
        union2.Visible = False
        union3.Visible = False
        LocalLbl.Visible = False
        Reqimage.Visible = False
    End If

End Sub

Other part of coding that doesn't work even though it is very similar:

<tr>
<td class="LeftAlign" colspan="2">
    <font class="Blackfont" size="1">
               <asp:CheckBox ID="MinorCheck" runat="server" NAME="BUSINESSCLASSIFICATION" 
               class="ownerClass" value="000" checked = "false" TabIndex="32"/>

               <asp:HyperLink ID="HyperLink2" runat="server" TABSTOP = "-1" onClick="OpenWindow('Images/Supp.html', 'Min Business Concern',600, 300, 'no')" font-Underline="True" ForeColor="#666666" >Minority Business Concern</asp:HyperLink> 
   </font>
</td>

</tr>
<tr>    
  <td>
     <asp:RadioButtonList ID="RadioButtonBClass" runat="server" AutoPostBack="True"
                            class="Bluefont" size="1" font-Bold="True" font-Size="8pt" visible = "false">

      <asp:ListItem Value="Y" >African-American male</asp:ListItem>
      <asp:ListItem Value="N">African-American female</asp:ListItem>
      <asp:ListItem Value="N">Asian-Indian American male</asp:ListItem>
      <asp:ListItem Value="N">Asian-Indian American female</asp:ListItem>
      <asp:ListItem Value="N">Asian-Pacific American male</asp:ListItem>
      <asp:ListItem Value="N">Asian-Pacific American female</asp:ListItem>
      <asp:ListItem Value="N">Native American male</asp:ListItem>
      <asp:ListItem Value="N">Native American female</asp:ListItem>

  </asp:RadioButtonList>
  </td>
</tr>

VB.NET

Protected Sub MinorCheck_CheckedChanged(sender As Object, e As EventArgs) Handles MinorCheck.CheckedChanged
    If (MinorCheck.Checked = true) Then
        RadioButtonBClass.Visible = True
        NonMinorCheck.Checked = false
    Else
        RadioButtonBClass.Visible = False
    End If
End Sub




Aucun commentaire:

Enregistrer un commentaire