开发者

Problem in enabling/disabling checkbox using javascript

开发者 https://www.devze.com 2023-02-24 01:03 出处:网络
My problem is enabling a checkbox in javascript but in disabling my codes is running properly.. i already to change chk1.enabled = checked but its not working..

My problem is enabling a checkbox in javascript but in disabling my codes is running properly.. i already to change chk1.enabled = checked but its not working..

here's my code:

<script language="javascript" type="text/javascript">

    function ckGrp(){

    var ck_arr = document.getElementsByName('chkRaps');
    var ck = document.getElementsByName('chkPPS');
    if(ck.checked == true){
           ck_arr.disabled = true;
    }else{
          ck_arr.disabled = false;
            }

    }

   </script>

asp.net code:

<td><asp:CheckBox OnClick="ckGrp(); " ID="chkPPS" runat="server" /> &nbsp;<asp:Label ID="Label2" 
        runat="server" Text="Bill Under PPS"></asp:Label>


  <td><asp:CheckBox ID="chkRaps" runat="s开发者_如何学编程erver" ClientIDMode="Static" Enabled="False" /> &nbsp;<asp:Label ID="Label3" 
        runat="server" Text="Include first billable visit for RAPs"></asp:Label><br/>
        <asp:CheckBox ID="chkTarNumber" runat="server" ClientIDMode="Static" Enabled="False"/> &nbsp;<asp:Label ID="Label4" 
        runat="server" Text="Use Claim Oasis Matching Key as TAR Number"></asp:Label><br/>
        <asp:CheckBox ID="chkPPSMedthod" runat="server" ClientIDMode="Static" Enabled="False" /> &nbsp;<asp:Label ID="Label5" 
        runat="server" Text="Effective 01/01/08 use new PPS Payment Method"></asp:Label><br/>
        <asp:CheckBox ID="chkMTP" runat="server" ClientIDMode="Static" Enabled="False" /> &nbsp;<asp:Label ID="Label6" 
        runat="server" Text="Auto Adjust Claim Amount to Match Total Payment"></asp:Label><br/>
        for differences within +/-<asp:TextBox ID="txtMTP" runat="server" Enabled="False"></asp:TextBox>


Change it to:

chk1.disabled = true;

And it'll work. To re-enable, just change the true to false.

0

精彩评论

暂无评论...
验证码 换一张
取 消