473,395 Members | 1,616 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.

Automatically uncheck check/uncheck button on unchecking one selection

13
Hi,
I have 5 checkbox elements,
i.e:

( 1 ) a
( 2 ) b
( 3 ) c
( 4 ) d
( Check/Uncheck all )

i want to check all the selections if the check button is check and uncheck all the selections when the uncheck button is unchecked but here's the catch, if i uncheck the 1st selection or other selections the check/uncheck button will automatically uncheck too. can anyone help me please?
Jul 30 '07 #1
5 2779
gits
5,390 Expert Mod 4TB
hi ...

please post the code you already have, the check- and uncheck-controls are checkboxes too? ... please show the html too ...

kind regards
Jul 30 '07 #2
kid
13
heres my code:

[HTML]<form name="myform" action="myform.php" method="post">
<b>Your Favorites</b><br>
<input type="checkbox" name="list" value="1">Pie<br>
<input type="checkbox" name="list" value="2">Pizza<br>
<input type="checkbox" name="list" value="3">Candy<br>
<input type="checkbox" name="list" value="4">Soda<br>
<input type="checkbox" name="list" value="5">Antacids<br>

<input type="checkbox" name="listAllCheck" value="listAllCheck" onClick="checkAll(document.myform.list,this)"><str ong>Check / Uncheck All</strong><br>
</form>


<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function checkAll(checkname, checksubmit) {
for (i = 0; i < checkname.length; i++)
checkname[i].checked = checksubmit.checked? true:false
}
// End -->
</script>[/HTML]
Jul 30 '07 #3
gits
5,390 Expert Mod 4TB
hmmm ... ok ... but i don't get the problem. you check the check-all checkbox and all checkboxes will be checked, uncheck it ... unchecks all boxes ... and now? when checking/unchecking a box from the list - nothing happens, so what behaviour do you want to have?

kind regards
Jul 30 '07 #4
acoder
16,027 Expert Mod 8TB
Changed the thread title.

Please use meaningful titles. Thank you.
Jul 31 '07 #5
acoder
16,027 Expert Mod 8TB
Hi,
I have 5 checkbox elements,
i.e:

( 1 ) a
( 2 ) b
( 3 ) c
( 4 ) d
( Check/Uncheck all )

i want to check all the selections if the check button is check and uncheck all the selections when the uncheck button is unchecked but here's the catch, if i uncheck the 1st selection or other selections the check/uncheck button will automatically uncheck too. can anyone help me please?
I think this link will help.
Jul 31 '07 #6

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

Similar topics

2
by: Mike Kim | last post by:
hi all, i have a checklistbox populated with about 50 items from database. and on the same form, i added to button to do the following. if you click this button, i want to have all items in the...
1
by: walkerhunter | last post by:
I have the three embedded Ruby(erb) check_boxes below: Patient #1<%= check_box("patient", '1', {}, "yes","no") %></br> Patient #2<%= check_box("patient", '2', {}, "yes","no") %></br> Patient...
1
by: Curtis | last post by:
I am having a problem with the coding below that someone was trying to help me with in another website. I have been to several websites and hopefully here I can get it resolved. I inherited this...
1
navenchary
by: navenchary | last post by:
hi I need some help regarding the checking and unchecking of the check boxes in yahoomail or gmail or any other mail. By checking the check all button we can select all the mails in the same way...
0
by: =?Utf-8?B?cmZsYXphcm8=?= | last post by:
Hi All, Control Panel -Regional and Language Options: Languages Tab --We are trying to build an automation utility to configure OS. One of the process to be automated that I haven't been able to...
5
by: Andrew Meador | last post by:
I have a form (Change Card List by Status) with a check box (cboNOT) and a list box (lstStatus). There is an Open Report button that opens a report (Report - Change Card List) which uses a query...
1
by: Anuj | last post by:
Hi, since sometime I'm stuck in a problem where I want to check or uncheck all the checkboxes. If I'm choosing name for the checkbox array as 'chkbx_ary' then I'm able to check/uncheck all the...
2
by: Destiny111 | last post by:
Hi! I have a gps program which works only when the "manage gps automatically" function is checked in the PDA settings. I do not want to enable user to disable my gps coords logging by uncheck...
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?
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
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.