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.
|
|
|
|
|
![]() |
||
Unchecking specified checkboxes in a table
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
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 |
|
|
![]() |
| Tags |
| checkbox |
| Thread Tools | |
|
|
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 |