views:

180

answers:

3

hi

i have one table where i have select the row by checking check box. I wanted to add selected checkbox rows to another table which is dynamically created when some one check checkbox.

I am waiting for you response

A: 
rahul
the above code will remove the column from existing table and add to another table i wanted that it will not remove it just add to new table thanks
ricky roy
Going great but the problem is this when some one uncheck the check button it also remove from the location?
ricky roy
Working Demo : I see your working demo. But i need when some one check it add to the table and when some one un checked main table it is also remove from the parent table (which is dynamically created by the user)
ricky roy
See my second working demo. Hope that helps.
rahul
Great Rahul. Thanks dude Going great. You have great future ahead. Best Of Luck.
ricky roy
Thanks @ricky. Glad to hear that it helped.
rahul
A: 

Basically as rahul suggested but a minor addition adding clone()

$('#first_table_id input:checkbox').click(function() {
    $(this).closest('tr').clone().appendTo('#second_table_id');
});

Jquery API documentation is your friend :)

Lawrence
This will add the row when the checkbox is unchecked also.
rahul
A: 

Hello!!that's great rahul but it's just temporary displayed,it's not loaded into the web page!!when we refresh the page the second table disappear!!i mean we can't get the row's value of the second table!!so can someone do this:remove the row "checked" in the first table and really append it into a new table and then we can use the new table's rows!! can someone help me please?!thanks!!

rico