Help with script
<p>I have found a script to add text box to the window using button. But problem is the logic used to add text boxes is using <code>div</code>. Using div tag increases the page length as it uses a lot of blank space. Please help me with the script such that I can add text boxes in the tabular form that is in the <code>tr</code> &amp; <code>td</code> tags.</p>

<p>PHP page script.</p>

<pre><code>&lt;td COLSPAN="3"&gt;&lt;DIV id='TextBoxesGroup'&gt;&lt;DIV id="TextBoxDiv1"&gt;&lt;LABEL&gt;Track #1 : &lt;/LABEL&gt;
&lt;input name="textbox1[]" type='text' size="60" id='textbox11' &gt;
&lt;input name="textbox2[]" type='text' size="35" id='textbox21' &gt;
&lt;/DIV&gt;&lt;/DIV&gt;&lt;/td&gt;
</code></pre>

<p>Javascript..</p>

<pre><code>    $(document).ready(function(){
var counter = 2;

$("#addButton").click(function () {
if(counter&gt;25){
alert("Only 25 textboxes allow");
return false;
}   
var newTextBoxDiv = $(document.createElement('div'))
.attr("id", 'TextBoxDiv' + counter);

newTextBoxDiv.after().html('&lt;label&gt;Track #'+ counter + ' : &lt;/label&gt;' +
'&lt;input name="textbox1[]" size="60" type="text" id="textbox1' + counter + '"&gt;' + '&amp;nbsp;'+  '&lt;input name="textbox2[]" size="35" type="text" id="textbox2' + counter + '"&gt;' );

newTextBoxDiv.appendTo("#TextBoxesGroup");


counter++;
});

$("#removeButton").click(function () {
if(counter==1){
alert("No more textbox to remove");
return false;
}   

counter--;

$("#TextBoxDiv" + counter).remove();

});

$("#getButtonValue").click(function () {

var msg = '';
for(i=1; i&lt;counter; i++){
msg += "\n Textbox #" + i + " : " + $('#textbox' + i).val();
}
alert(msg);
});
});
</code></pre>
