H
HoustonLucifer
Hi all, i have two questions
1) I have an asp page where the user clicks on an add button which adds rows
to the HTML table. When the user clicks on the submit button the same form
is posted again. How do i know how many rows the user added to the table. I
can get it in the script tag but i need to do this in the <%%> tag. I have
to get these values and insert into the database. All the controls created
dynamically are named volume1, volume2 etc.,
2) Since i have to go through the loop and insert the rows from the table
mentioned above, is there any way to write a generic insert statement. The
below code shows what i am trying to do.
volume1 = Request.Form("volume1text")
volume2 = Request.Form("volume2text")
volume3 = Request.Form("volume3text")
For i = 1 to 3
If i = 1 Then
"Insert into table values (" & volume1 & ")"
Elseif i = 2 Then
"Insert into table values (" & volume2 & ")"
Else
"Insert into table values (" & volume3 & ")"
Next
What i want to do is write something like the following. How can i do this.
The following variablr volInsert is being treated as string. Volume is a
text field.
For i = 1 to 3
volInsert = "volume" & i
"Insert into table values ('" & volInsert & "')"
Next
Thanks
1) I have an asp page where the user clicks on an add button which adds rows
to the HTML table. When the user clicks on the submit button the same form
is posted again. How do i know how many rows the user added to the table. I
can get it in the script tag but i need to do this in the <%%> tag. I have
to get these values and insert into the database. All the controls created
dynamically are named volume1, volume2 etc.,
2) Since i have to go through the loop and insert the rows from the table
mentioned above, is there any way to write a generic insert statement. The
below code shows what i am trying to do.
volume1 = Request.Form("volume1text")
volume2 = Request.Form("volume2text")
volume3 = Request.Form("volume3text")
For i = 1 to 3
If i = 1 Then
"Insert into table values (" & volume1 & ")"
Elseif i = 2 Then
"Insert into table values (" & volume2 & ")"
Else
"Insert into table values (" & volume3 & ")"
Next
What i want to do is write something like the following. How can i do this.
The following variablr volInsert is being treated as string. Volume is a
text field.
For i = 1 to 3
volInsert = "volume" & i
"Insert into table values ('" & volInsert & "')"
Next
Thanks