Solved

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

Posted on 2007-11-13
2
594 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
ID: 20276361
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
ID: 20276488
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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains the steps required to use the default Photos screensaver to display branding/corporate images
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

840 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