Addiing rows

Addiing rows

I have

  1. function add_question() {
               alert(row_count);
                row = row_count - 1
                $( "#row" + row).after( "<tr id='row" + row_count +  "'><td style='width: 1%''><input name='B3' type='reset' value='Delete'></td><td style='width: 1%'><h3>Question</h3></td><td width='35%'><textarea cols='20' name='S1 rows='5' style='width: 100%; color: #000000; font-family: Arial; font-size: 10pt'></textarea></td></tr>");
                alert("<tr id='row" + row_count +  "'><td style='width: 1%''><input name='B3' type='reset' value='Delete'></td><td style='width: 1%'><h3>Question</h3></td><td width='35%'><textarea cols='20' name='S1 rows='5' style='width: 100%; color: #000000; font-family: Arial; font-size: 10pt'></textarea></td></tr>");
                row_count = row_count + 1;   
               
            }

It is adding the new Table rows ok but there is a problem. If you type something into any of the text areas then add a new row it removes anything you have typed in. Why and what do I do about it please?
    • Topic Participants

    • info