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:
  #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!
 
Create the Optimal Architecture for your Critical Applications
Warburton's the largest independently owned bakery in the UK faced a number of difficult challenges in providing the most robust yet efficient IT infrastructure for their organization's success. IBM's services combined with their xSeries servers created the perfect platform for their SAP environment with sufficient flexibility, and did so in very time effective fashion.

Request Your Free Technology Downloads!
 
Five Best Practices for Deploying a Successful Service-Oriented Architecture
This white paper describes the benefits you can expect with SOA, and how IBM can help take your business there.

Request Your Free Technology Downloads!
 
Gartner Magic Quadrant for Application Delivery Controllers
Gartner summarizes its view on Application Delivery Controllers, evaluates strengths and weaknesses of solutions, and provides Magic Quadrant reporting for a quick comparison across all vendors. Learn from Gartner how you can benefit from an all-in-one device like Citrix NetScaler that delivers the highest levels of availability, performance and security.

Request Your Free Technology Downloads!
 
Knowledge is Power
What you don't know can hurt you, and is likely costing you money and increasing your security risks during an era of scarce resources. This white paper proposes six key strategies that enterprise security managers can use to improve their network defense posture.

Request Your Free Technology Downloads!
 
Rationalizing the Multi-Tool Environment
The rationalized multi-tool approach is flexible, scalable and cost effective. It provides the necessary input to the IT service management business processes. It preserves prior investments in monitoring tools, empowers technologists to select the best tools with which to do their jobs, and enhances effective response to incidents.

Request Your Free Technology Downloads!
 

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




© 2003-2010 by Developer Shed. All rights reserved. DS Cluster 3 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek