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, 06: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, 06: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, 04: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!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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




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