473,373 Members | 1,407 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,373 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 34656
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 ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.