Line 15 could be simplified into this:
Main Topics
Browse All TopicsHello,
I am new to javascript and jquery, but would like to have this done in jquery. I have one main checkbox and 4 sub checkboxes. What I would like is upon selecting the main checkbox this would then select/toggle the check in the the other 4 checkboxes. If main checkbox is unchecked then check is removed from other 4 checkboxed as well. Any code or examples that can be provided so that I can follow, would be much appreciated...
Thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
You need to change this line according to your jquery version :
<script type="text/javascript" src="jquery-1.2.6.pack.js"
</script>
And, maybe you didn't try it right. The code I posted uncheck BCD when you check A. It was an example and should be adapted for your needs.
I think you could get the code you need mixing cxr and mine code.
use $('#boxid1,#boxid2) to select boxes by id, or, $('.boxclass') to select boxes by class.
flob9,
your script did not work the way the asker wanted. A toggle function was requested, your script only unchecks, it does not check.
Both $(function{}) and jQuery(function($){}) are aliases for $(document).ready().
http://docs.jquery.com/Cor
http://docs.jquery.com/
Business Accounts
Answer for Membership
by: cxrPosted on 2009-08-07 at 11:23:26ID: 25045579
Try this:
Select allOpen in new window