473,387 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Help me in solving this javascript challenge

Below are 2 checkboxs on a form

[HTML]<input type="checkbox" name="edit[files][8][list]" id="edit-files-8-list" value="1" onclick="disableRow1(this)" class="form-checkbox" />

<input type="checkbox" name="edit[files][9][list]" id="edit-files-9-list" value="1" onclick="disableRow1(this)" class="form-checkbox" />
[/HTML]
I have to write a function to disable other checkbox when anyone is clicked.

Problem here is that checkbox name is in array form "edit[files][9][list]", which is making difficult to set its property.

Please help me in solving this problem.


Thanks,
Sumoanand
Jul 18 '07 #1
1 918
Logician
210 100+
I have to write a function to disable other checkbox when anyone is clicked.
If I understand correctly, this will do it. It assumes that both checkboxes are in the same form:
Expand|Select|Wrap|Line Numbers
  1. <form>
  2.  <input type="checkbox" name="edit[files][8][list]" id="edit-files-8-list" value="1" onclick="disableRow1(this,'edit[files][9][list]')" class="form-checkbox" />
  3.  
  4.  <input type="checkbox" name="edit[files][9][list]" id="edit-files-9-list" value="1" onclick="disableRow1(this,'edit-files-8-list')" class="form-checkbox" />
  5.  
  6. </form>
  7.  
  8. <script type='text/javascript'>
  9.  
  10. function disableRow1(master, slave)
  11. {
  12.  master.form[slave].disabled=master.checked;   
  13. }
  14.  
  15. </script>
  16.  
Jul 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Duane Lambe | last post by:
Hi folks - site's at http://www.datawire.net/files/intranet.html ; works fine in IE, but open in Firebird/Moz/Opera, and you can see that the word "Home" near the top doesn't move down to line up...
0
by: dnphamus13 | last post by:
I'm new to this and drowning right now. I would like to put my database online for viewing. I managed to do the filtering but i need to do PAGING as the XML doc get bigger. From what i understand...
3
by: Mike Dee | last post by:
Hi, I'm having an issue with the status bar in Mozilla and Netscape showing that it is still waiting on the page to load even after it is finished. This problem does NOT occur with IE. In...
0
by: Joel | last post by:
This is the full background of my problem. I´m working with a client who connects to a secure webservice. I´m using VS 2003 .Net. with WSE 2.0 sp3 and the .Net 1.1 framework I got no access...
23
by: codefire | last post by:
Hi, I am trying to get a regexp to validate email addresses but can't get it quite right. The problem is I can't quite find the regexp to deal with ignoring the case james..kirk@fred.com, which...
8
by: Senderos | last post by:
Hello, i try to break this code, since many days (and nights), without any success : <script type="text/javascript"> function p(a,i,c) { var x=a.charCodeAt(i)+c;
9
by: steve | last post by:
hi, Has anyone come across a "hack" to do a dns look up via JS I want to evaluate an email address against a server to see if it is valid , I'm 50 % of the way there but i need a way to look...
53
by: souporpower | last post by:
Hello All I am trying to activate a link using Jquery. Here is my code; <html> <head> <script type="text/javascript" src="../../resources/js/ jquery-1.2.6.js"</script> <script...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.