Unchecking specified checkboxes in a table

This is a discussion on "Unchecking specified checkboxes in a table" within the JavaScript Forum section. This forum, and the thread "Unchecking specified checkboxes in a table are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 6th, 2007, 08:22
New Member
Join Date: Mar 2007
Location: boro
Age: 29
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Unchecking specified checkboxes in a table

I have a table with 12 checkboxes. I have the following function which when I check the last checkbox in the table, the first 10 checkboxes in the table are unchecked. -

function modify_boxes(to_be_checked,total_boxes){ for ( i=0 ; i < total_boxes ; i++ ){ if (to_be_checked){ document.forms[0].x[i].checked=true; } else{ document.forms[0].x[i].checked=false; } } }

I have the following in 'onclick' on the last checkbox in the table -

modify_boxes(false,10)

What I would like to happen, is when the first checkbox in the table is checked, that only the last two checkboxes in the table are unchecked. However the names of the checkboxes must all be 'x' as they are referenced elsewhere

thanks in advance
Reply With Quote

Reply

Tags
checkbox

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Saving values from checkboxes into MySql karinne PHP Forum 7 Jan 26th, 2008 16:58
FormMail and checkBoxes AGAIN aarrrrgh Morgado Flash & Multimedia Forum 1 Aug 23rd, 2007 11:56
Help with asp code for checkboxes speakma Classic ASP 1 May 22nd, 2007 11:17
How to get value of selected dynamic checkboxes? frmsasp ASP.NET Forum 1 Nov 3rd, 2005 12:59
repopulate checkboxes from database codefantom Classic ASP 1 Aug 29th, 2005 22:28


All times are GMT. The time now is 22:37.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43