Solved

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

Posted on 2007-11-13
2
609 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Successful collaboration among team members is essential for the growth of your business. When employees work together on projects, share ideas and communicate effectively they get better results.
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

628 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