Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uncheking and disabling of Checkbox! Help!!!

Status
Not open for further replies.

aspengal

Technical User
Dec 27, 2004
41
US
I have a 4 checkboxes. When the 1st one is unchecked, remaining 3 should be disabled and unchecked. Iam not able to achieve both unchecked and disabled at the same time.
This is my code.
********
HTML
<td valign="top" nowrap class="bodyTextBold" colspan="5">&nbsp;&nbsp;GW Impact:
<asp:CheckBox ID="chkGWImpact" Runat="server" onclick="ChkGWImpact();setCheckBoxChanged();"></asp:CheckBox>
Dissolved (Delineated):
<asp:CheckBox ID="chkDissolvedDelineated" Runat="server" onclick="setCheckBoxChanged();"></asp:CheckBox>
(Offsite):
<asp:CheckBox ID="chkDissolvedOffsite" Runat="server" onclick="setCheckBoxChanged();"></asp:CheckBox>
(Commingled):
<asp:CheckBox ID="chkDissolvedCommingled" Runat="server" onclick="setCheckBoxChanged();"></asp:CheckBox></td>
<tr valign="top">
**********************
.aspx
function ChkGWImpact(){
document.getElementById('chkDissolvedDelineated').disabled = false;
document.getElementById('chkDissolvedOffsite').disabled = false;
document.getElementById('chkDissolvedCommingled').disabled = false;
if(!document.forms[0].elements['chkGWImpact'].checked){
document.getElementById('chkDissolvedOffsite').disabled = true;
document.getElementById('chkDissolvedOffsite').disabled = true;
document.getElementById('chkDissolvedCommingled').disabled = true;
}
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top