I have a table with a default number of rows drawn with vbscript so that text boxes in each row are named 'name'&rownumber via code similar to below:
<%
ctr=1
Response.Write "<table><tr><td>Q1</td></tr>"
Do until ctr=2
Response.Write "<tr><td><input type=text name=Q1"&ctr&">"
Response.Write "</td></tr>"
ctr=ctr+1
Loop
Response.Write "</table>"
%>
Is there a way to use javascript to dynamically draw or erase rows if the user needs more room? The new rows need to have the input objects named correctly so that I can validate each row and update a database.
The way I have it now is they can enter the number of rows they want in a textbox, submit a blank form and it redraws the table with the number of rows they want. This clears the form though. The only other way I would do it is save the table data in a temp table, then redraw the table and filling in the data that was already there. If need be I guess I will code it that way. Thanks!
<%
ctr=1
Response.Write "<table><tr><td>Q1</td></tr>"
Do until ctr=2
Response.Write "<tr><td><input type=text name=Q1"&ctr&">"
Response.Write "</td></tr>"
ctr=ctr+1
Loop
Response.Write "</table>"
%>
Is there a way to use javascript to dynamically draw or erase rows if the user needs more room? The new rows need to have the input objects named correctly so that I can validate each row and update a database.
The way I have it now is they can enter the number of rows they want in a textbox, submit a blank form and it redraws the table with the number of rows they want. This clears the form though. The only other way I would do it is save the table data in a temp table, then redraw the table and filling in the data that was already there. If need be I guess I will code it that way. Thanks!