View Full Version : jQuery Cloning and inserting

09-06-2009, 02:58 PM
I have the following html code:

<tr id="InputRow">
<input type="text" name="..." value=""/>

and JavaScript code:

function AddRow(far)
var rowclone=$('#InputRow').clone(); //clone the row
for (i=0; i<far.length; i++)
if (i == 0)
$('#InputRow').nextAll("tr:last").after(rowclone); //insert a new row after the existing at the end

AddRow(ar); //JSON object with a simple array

So what I need to do is to simply clone the row, substitute new values from an array and insert it at the end of existing row (if array's size more then 1). But this doesn't work! Where is an error?

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum