Connecting Tech Pros Worldwide Help | Site Map

Checking and unchecking of checkboxes

  #1  
Old July 1st, 2009, 11:59 PM
Newbie
 
Join Date: Jul 2009
Posts: 7
Hi,

I have a list of around 10 checkboxes, when the user checks on say around 3 checkboxes then the rest 7 of the checkboxes should be moved to another table and should be automatically checked.
Can anybody suggest me on how can I do this?

Thanks
  #2  
Old July 2nd, 2009, 01:50 AM
Dormilich's Avatar
Moderator
 
Join Date: Aug 2008
Location: Leipzig, Germany
Posts: 3,485
Provided Answers: 9

re: Checking and unchecking of checkboxes


could you elaborate more? your intention is not clear to me.
  #3  
Old July 2nd, 2009, 03:48 AM
Newbie
 
Join Date: Jul 2009
Posts: 7

re: Checking and unchecking of checkboxes


I should have a table with 2 columns in it, the first column will contain 10 checkboxes and a button(move) and the second column will be empty, when the user will click on say about 2 checkboxes and clicks on the button(move) available in the first column, then the rest of the checkboxes should be moved to the next column with the checkboxes being checked.
I hope am clear this time.

Thanks
  #4  
Old July 2nd, 2009, 11:55 AM
Newbie
 
Join Date: Jul 2009
Posts: 7

re: Checking and unchecking of checkboxes


Can somebody please help me out with my problem?
  #5  
Old July 2nd, 2009, 08:42 PM
dlite922's Avatar
Expert
 
Join Date: Dec 2007
Location: Moon, Dark Side
Posts: 1,075

re: Checking and unchecking of checkboxes


I don't have time to code but this is not a PHP problem, this thread should be moved to JavaScript.

Assuming you know the total number of checkboxes (fixed number), what you would do is in each column you would have a <div> container for each checkbox.

Of course in the beginning, all the checkboxes are in the left hand side and the right column <divs> will be empty.

then using the innerHTML() value, you move the content from the left div to the right one, such as.

Expand|Select|Wrap|Line Numbers
  1.  
  2. rightDiv_1.innherHTML = leftDiv_1.innerHTML; // copy it over to the right. 
  3. leftDiv_1.innerHTML = ""; // empty it. 
  4.  
  5.  
put the above code in a function and call it with the checkboxe's event trigger (such as onClick())

I hope that gives you an idea of where to start. If any problem, post it in the JavaScript forum. I'm sure those guys are much better JS scripters than me =)


Thanks,




Dan
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking and unchecking of checkboxes sakkat answers 3 July 3rd, 2009 11:49 AM
Check All CheckBoxes In GridView Via JavaScript Problem Frinavale answers 1 May 7th, 2008 08:49 PM
Disabling Manual Checking/Unchecking of CheckedListBox Items Phil Galey answers 1 November 22nd, 2005 11:46 AM
Disabling Manual Checking/Unchecking of CheckedListBox Items Phil Galey answers 1 July 21st, 2005 03:58 PM