views:

396

answers:

1

How do I append a row to a table using the prototype library.

This is part of a form so I would like to also find a way to increment the <input name="container[0]"> value. Is this possible?

+3  A: 

if i understand you right something like this would work:

var numrows = $$('#tableid tr').length;
$('tableRow').insert({after:'<tr><td><input type="text" name="container['+numrows+']"></td></tr>'});

if you can provide more details then i'll be able to help out a bit more

seengee