Solved

disabled a checkbox if one of the other 4 is checked and vice versa

Posted on 2007-11-13
2
588 Views
Last Modified: 2008-02-01
Hello Everyone,
This is my function

window.onload = main

function main(){

//ANGIE H.- Angie's Attempt to make NA one of the answers not the others
if((document.OPICForm.SME.checked == true || document.OPICForm.IndividualWorth.checked == true || document.OPICForm.WomanOwned.checked == true || document.OPICForm.MinorityOwned.checked ==true)){
      document.OPICForm.NA.disabled == true;
      document.OPICForm.NA.style.background == "#CCCCCC";
}
}

What I'm trying to do is disable the NA, Not Applicable checkbox if one of the other 4 are checked
HERE"S the HTML

   <tr>
      <td height="109" class="response">
        <input type="checkbox" id="SME" name="SME" value = <%=sSME%> <%=sSMEChecked%> />
        <b>(i)</b> Small or Medium Enterprise with revenues <= $250 million,<br /> <input type="checkbox" id="IndividualWorth" name="IndividualWorth" value = <%=sIndividualWorth%> <%=sIndividualWorthChecked%> />
        <b>(ii)</b> An individual with net worth <= $67 million,<br /> <input type="checkbox" id="WomanOwned" name="WomanOwned" value = <%=sWomanOwned%>  <%=sWomanOwnedChecked%> />
        <b>(iii)</b> A woman-owned business,<br /> <input type="checkbox" id="MinorityOwned" name="MinorityOwned" value = <%=sMinorityOwned%> <%=sMinorityOwnedChecked%> />
        <b>(iv)</b> A minority-owned business,<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        OR<br />
        <input type="checkbox" id="NA" name="NA" value = <%=sNA%> <%=sNAChecked%> />
        <b>(v)</b> None of the above descriptions apply to any shareholders.<br /> </td>
    </tr>



However my javaScript function's not working, for one thing it should be onBlur, not onLoad am I right?
I'll try that, but how do U do the vice versa, do U use an else?
0
Comment
Question by:Gemini532
2 Comments
 

Author Comment

by:Gemini532
Comment Utility
It's not working even though I added the function onBlur to each checkbox, I'm doing something wrong, can you help?
0
 
LVL 82

Accepted Solution

by:
hielo earned 500 total points
Comment Utility
change:
document.OPICForm.NA.disabled == true;
      document.OPICForm.NA.style.background == "#CCCCCC";

to
document.OPICForm.NA.disabled = true;
      document.OPICForm.NA.style.background = "#CCCCCC";

a single "="
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

This article will show you how to create an ISO CD-ROM/DVD-ROM image (*.iso), and MD5 checksum signature, for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5). It's a good idea to compare checksums, because many installations fail because of a corr…
In this article, I will show you HOW TO: Create your first Windows Virtual Machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, the Windows OS we will install is Windows Server 2016.
This video discusses moving either the default database or any database to a new volume.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now