Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old December 10th, 2002, 05:49 PM
casa casa is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 20 casa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to casa
JavaScript - Checkbox Disable Script

Depending on the radio button a user selects, I want to be able to disable the checkboxes for all the other courses. It works in IE, but I need to add scripting to address fact that Netscape does not support disable. Here's my code any ideas will be greatly appreciated:

php Code:
Original - php Code
  1.  
  2. <html>
  3. <head>
  4. <title>Untitled</title>
  5.  
  6. </head>
  7. <body>
  8. <form name="form1" id="form1" method="post" action="">
  9.   <table border="0" cellpadding="0" cellspacing="2">
  10.     <tr>
  11.       <td><input type="radio" name="gr1" value="Yes" onClick="Disab(1)"></td>
  12.       <td>US History 10</td>
  13.       <td><input type="checkbox" name="UHist10_01A" value="Yes" disabled></td>
  14.       <td>Section 01A</td>
  15.     </tr>
  16.     <tr>
  17.       <td colspan="2">&nbsp;</td>
  18.       <td><input type="checkbox" name="UHist10_02A" value="No" disabled></td>
  19.       <td>Section 02A</td>
  20.     </tr>
  21.     <tr>
  22.       <td colspan="2">&nbsp;</td>
  23.       <td><input name="UHist10_03A" type="checkbox" disabled id="UHist10_03A" value="Yes"></td>
  24.       <td>Section 03A</td>
  25.     </tr>
  26.     <tr><td colspan="4">&nbsp;</td></tr>
  27.     <tr>
  28.       <td><input type="radio" name="gr1" value="No" onClick="Disab(2)"></td>
  29.       <td>US History 11</td>
  30.       <td><input type="checkbox" name="UHist11_01A" value="Yes" disabled></td>
  31.       <td>Section 01A</td>
  32.     </tr>
  33.     <tr>
  34.       <td colspan="2">&nbsp;</td>
  35.       <td><input type="checkbox" name="UHist11_02A" value="No" disabled></td>
  36.       <td>Section 02A</td>
  37.     </tr>
  38.     <tr>
  39.       <td colspan="2">&nbsp;</td>
  40.       <td><input name="UHist11_03A" type="checkbox" disabled id="UHist11_03A" value="No"></td>
  41.       <td>Section 03A</td>
  42.     </tr>
  43.   </table>
  44. </form>
  45. <SCRIPT LANGUAGE="JavaScript">
  46. function Disab (val) {
  47.   if(val==1) {
  48.     document.form1.UHist10_01A.disabled=false;
  49.     document.form1.UHist11_01A.disabled=true;
  50.     document.form1.UHist11_01A.checked=false;
  51.    
  52.     document.form1.UHist10_02A.disabled=false;
  53.     document.form1.UHist11_02A.disabled=true;
  54.     document.form1.UHist11_02A.checked=false;
  55.    
  56.     document.form1.UHist10_03A.disabled=false;
  57.     document.form1.UHist11_03A.disabled=true;
  58.     document.form1.UHist11_03A.checked=false;
  59.   }
  60.   if(val==2) {
  61.     document.form1.UHist11_01A.disabled=false;
  62.     document.form1.UHist10_01A.disabled=true;
  63.     document.form1.UHist10_01A.checked=false;
  64.    
  65.     document.form1.UHist11_02A.disabled=false;
  66.     document.form1.UHist10_02A.disabled=true;
  67.     document.form1.UHist10_02A.checked=false;
  68.    
  69.     document.form1.UHist11_03A.disabled=false;
  70.     document.form1.UHist10_03A.disabled=true;
  71.     document.form1.UHist10_03A.checked=false;
  72.   }
  73. }
  74. </SCRIPT>
  75. </body>
  76. </html>

Reply With Quote
  #2  
Old December 10th, 2002, 05:52 PM
casa casa is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 20 casa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to casa
RE: JavaScript - Checkbox Disable Script

BTW, when all is said and done, I will be generating the table and javascript on the fly in PHP depending on what rows are returned from my database, based on which teacher logs in.

Reply With Quote
  #3  
Old December 13th, 2002, 03:35 AM
casa casa is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 20 casa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to casa
RE: JavaScript - Checkbox Disable Script

I gave up on this script because I finally figured out that the .disable is a Microsoft thing and not supported by Netscape. I was going to have to jump through so many hoops for Netscape it decided to go to a script that just pops an alert box when you try to click on more than one group of checkboxes. AND I'm generating in on the fly with a PHP script. Pretty slick. It was easy to do when I just had 2 sets of three or three sets of two, but I has several that were a mixture of ones, twos, and maybe some threes and that was tough, but I finally got it going. If anyone wants to see it, respond and I'll post it.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > JavaScript - Checkbox Disable Script


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five &quot;checkpoints&quot; for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway