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?
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?
Share Improve this question edited Dec 29, 2011 at 15:42 Rob W 349k87 gold badges807 silver badges682 bronze badges asked Oct 23, 2009 at 20:05 vicTROLLAvicTROLLA 1,52912 silver badges16 bronze badges 1- oh it chopped out my html. I want to increment the name="inputname[0]" portion of an input tag within the row. – vicTROLLA Commented Oct 23, 2009 at 20:08
1 Answer
Reset to default 7if 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