Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

Checkbox will not unhide with onlick

$
0
0

So i have some javscript working with a modal popup, my problem is I need certain things to hide or unhide based on a radiobutton list check.

I have the first portion working of the radiobutton check to unhide the dropwdownlist, but it does not unhide the  checkbox as well, is there something different I have to do?

 

<script type="text/javascript">
             function GetListItem() {
                 //Get the radiobuttonlist reference
                 var rblList = document.getElementById("<%=rblRecType.ClientID%>");
                 var RecTeam = document.getElementById("<%=ddlRecTeam.ClientID%>");
                 var region = document.getElementById("<%=ddlRegion.ClientID%>");
                 var Ncoic = document.getElementById("<%=cbNcoic.ClientID%>");

                 var radios = rblList.getElementsByTagName("input");
                 var RadVal;
                 for (var i = 0; i < radios.length; i++) {
                     if (radios[i].checked) {
                         var RadVal = radios[i].value;
                         if (RadVal == 1) {
                             RecTeam.style.display = "inline";
                             Ncoic.style.display = "inline";    (Will not display this control like I need it too
                             region.style.display = "none";

                         }
                         else if (RadVal == 2) {
                             RecTeam.style.display = "none";
                             Ncoic.style.display = "none";
                             region.style.display = "none";
                         }
                         else if (RadVal == 3) {
                             RecTeam.style.display = "inline";
                             Ncoic.style.display = "none";
                             region.style.display = "none";
                         }
                         else if (RadVal == 4) {
                             region.style.display = "inline";
                             RecTeam.style.display = "none";
                             Ncoic.style.display = "none";
                         }
                     }
                 }
             }</script>

<asp:CheckBox ID="cbNcoic" runat="server" TextAlign="Right" Text="Assistant NCOIC"  Font-Size="Small" style="display:none" />


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>