Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2007-11-13
2
Medium Priority
?
636 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 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In this post, I will showcase the steps for how to create groups in Office 365. Office 365 groups allow for ease of flexibility and collaboration between staff members.
There can be many situations demanding the conversion of Outlook OST files to PST format and as such, there is no shortage of automated tools to perform this conversion. However, what makes Stellar OST to PST converter stand above the rest? Let us e…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

877 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