473,395 Members | 1,639 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,395 software developers and data experts.

checkbox onclick check another checkbox

Title says all, if a user check checkbox1 chechbox3 will also be checked,
how do I do this? Have searched around but kan only find out how to check
the same box

Terje
Jul 23 '05 #1
5 34658
Terje wrote on 17 nov 2004 in comp.lang.javascript:
Title says all, if a user check checkbox1 chechbox3 will also be checked,
how do I do this? Have searched around but kan only find out how to check
the same box


<input type=checkbox
onclick="if(this.checked)
document.getElementById('cb3').checked=true">check box1<br>

<input type=checkbox id=cb3>checkbox3

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 23 '05 #2
tanks....

"Evertjan." <ex**************@interxnl.net> skrev i melding
news:Xn********************@194.109.133.29...
Terje wrote on 17 nov 2004 in comp.lang.javascript:
Title says all, if a user check checkbox1 chechbox3 will also be checked, how do I do this? Have searched around but kan only find out how to check the same box


<input type=checkbox
onclick="if(this.checked)
document.getElementById('cb3').checked=true">check box1<br>

<input type=checkbox id=cb3>checkbox3

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 23 '05 #3
Evertjan. wrote:

<input type=checkbox
onclick="if(this.checked)
document.getElementById('cb3').checked=true">check box1<br>

<input type=checkbox id=cb3>checkbox3


<input type="checkbox"
onclick="document.getElementById('cb3').checked=th is.checked"> checkbox1<br>

<input type="checkbox" id="cb3">checkbox3

Mick
Jul 23 '05 #4
"Terje" <te***@cyberfactory.no> wrote in message news:<tS********************@news000.worldonline.d k>...
tanks....

"Evertjan." <ex**************@interxnl.net> skrev i melding
news:Xn********************@194.109.133.29...
Terje wrote on 17 nov 2004 in comp.lang.javascript:
Title says all, if a user check checkbox1 chechbox3 will also be checked, how do I do this? Have searched around but kan only find out how to check the same box


<input type=checkbox
onclick="if(this.checked)
document.getElementById('cb3').checked=true">check box1<br>

<input type=checkbox id=cb3>checkbox3

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)


Title doesn't really 'say it all'...what happens when the user
un-checks checkbox3? Oh, well....

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>untitled</title>
</head>
<body>
<form style="width:100px;">
<input type="checkbox" name="checkbox1" value="on"
onclick="checkbox3.checked=this.checked" /> checkbox1
<input type="checkbox" name="checkbox2" value="on" /> checkbox2
<input type="checkbox" name="checkbox3" value="on" /> checkbox3
</form>
</body>
</html>
Jul 23 '05 #5
Mick White wrote on 18 nov 2004 in comp.lang.javascript:
Evertjan. wrote:

<input type=checkbox
onclick="if(this.checked)
document.getElementById('cb3').checked=true">check box1<br>

<input type=checkbox id=cb3>checkbox3


<input type="checkbox"
onclick="document.getElementById('cb3').checked=th is.checked">
checkbox1<br>

<input type="checkbox" id="cb3">checkbox3


Very nice, but not what the OP asked !!!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: LRW | last post by:
Very basic, very simple, but I can't get a checkbox to check when the value of a text field changes to something greater than 0. Here's what I have: THE JAVASCRIPT: <script...
1
by: Michel Bany | last post by:
Hello everybody, I am attaching an onclick event handler to a checkbox, using a <script> tag <script>document.getElementById(id).onclick = ...</script> and I have three questions. 1) In the...
1
by: .NETn00b | last post by:
Is this possible? I need to create a multi-select DataGrid, and I cannot use CheckBoxes. I want the selected rows to appear highlighted. One possible work-around that occurred to me was to...
3
by: ccordero | last post by:
Hi! I am working with asp.net 1.1 and javascript. I have a client side checkbox, a client side button, and an asp.net image button. When I check the checkbox, I want the client side button...
10
by: rn5a | last post by:
All the rows in a DataGrid, including the Header, are accompanied with a CheckBox. I want that when the CheckBox in the Header is checked, then all the CheckBoxes should automatically get checked....
9
by: morellik | last post by:
Dear all, I have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked. function tarInfo(info) { var i=0; var c=0;...
0
by: cvijaykrishna | last post by:
i am having a web based application and i am having a problem with it pls check it Explanationi am sending a sample code plese see it in VS-2005 FOR BETTER UNFERSTANDING I have a main page...
4
by: Aaron Gray | last post by:
The following input checkbox onclick via DOM is not working on IE7, FF, or WebKit, but is working on Opera for some strange reason. http://www.aarongray.org/Test/JavaScript/checkbox.html ...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.