HTML Help Forum Index HTML Help
Please Search for the answer to your question before asking it! Thanks.
 

How to dynamically generate table rows
Post a Reply to this Topic Ask a New Question
Click here to go to the original topic
       HTML Help Forum Index -> Javascript
View previous topic :: View next topic  
Author Message
ralamo



Joined: 28 Feb 2005
Posts: 9

Posted: Mon Feb 28, 2005 8:49 pm     How to dynamically generate table rows  

I've a requirement wherein, i should have a table and a single row with 12 columns in it.Each column except the first column, has a textfield in it. The first column has a checkbox. At the bottom of the table i've a 'Add' & 'Delete' button. When the user clicks on 'add' button, one new row should get entered into the table. This way he can create 'n' number of rows in that table.

After adding the rows, if the user doesn't want any of those rows, he can check the checkbox in the first column of that row and click on 'Delete' button at the bottom of the table and delete those rows. He should be able to delete 'n' number of rows at one shot if he is wants to.

I don't know how to implement this entire logic in html. If anyone know how to do it, pls help me with ideas or code snippet. It will be a great help to me.

Thanks.
degsy



Joined: 23 Feb 2005
Posts: 2440
Location: North East, UK

Posted: Tue Mar 01, 2005 9:01 am      

can't be done in HTML.
It would have to be done in script either Javascript, which would be complicated using DOM to create/delete elements and structures or PHP where a simple loop could probably be used.
ralamo



Joined: 28 Feb 2005
Posts: 9

Posted: Wed Mar 02, 2005 10:11 pm      

Yes .... i used Javascript to do that. But problem in deleting the rows. I could able to delete multiple rows once. Later i can't ... b'coz the id numbers change and the loop terminates b'coz it's unable to find the checkboxes with those names.
chug



Joined: 28 Jan 2006
Posts: 1

Posted: Sat Jan 28, 2006 4:34 pm     The attached .js file in the link below might help.  

Havent tried exactly what youre doing though. Hope it helps.

http://www.crunchycode.com/sqlforjavascript.htm
 
 
DARFUR
HOSTING / DESIGN
MAKE MONEY

       HTML Help Forum Index -> Javascript
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.19 © 2001, 2002 phpBB Group