Connecting Tech Pros Worldwide Forums | Help | Site Map

Checking and unchecking of checkboxes

Newbie
 
Join Date: Jul 2009
Posts: 7
#1: Jul 3 '09
Hi,
I should have a table with 2 columns in it, the first column will contain 10 checkboxes(the number is not fixed it changes dynamically) 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

acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#2: Jul 3 '09

re: Checking and unchecking of checkboxes


Post what you've managed so far.

You'll have to get a list of the checkboxes:
Expand|Select|Wrap|Line Numbers
  1. var checkboxes = document.getElementsByName("nameOfCheckbox");
and loop over the node-list. When you click the move button, do you want to move the checked checkboxes or the unchecked ones?
Newbie
 
Join Date: Jul 2009
Posts: 7
#3: Jul 3 '09

re: Checking and unchecking of checkboxes


When I click on move button the unchecked boxes should be moved...
acoder's Avatar
Site Moderator
 
Join Date: Nov 2006
Location: UK
Posts: 14,581
#4: Jul 3 '09

re: Checking and unchecking of checkboxes


That seems a bit unintuitive, but anyway, post your code and show what problems you're having trying to implement it.
Reply