Solved

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

Posted on 2007-11-13
2
590 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Batch File to Telnet 10 3,288
Problem to the codes 3 85
Problem with jscript mask. 3 92
Javascript CSS: click on left panel header opens right panel 4 74
Scenario: Your operations manager has discovered an anomaly in your security system. The business will start to suffer within 15 minutes if it is a major IT incident. What should she do? We have 6 recommendations for managing major incidents (https:…
Knowledge base software has turned out to be a quite reliable method for storing information, promoting collaborative work and for sharing valuable input and solutions.However, some organizations are trying to develop a knowledge base that works wit…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

895 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

15 Experts available now in Live!

Get 1:1 Help Now