scripter50
IS-IT--Management
I have an ASP page with a dynamically generated form, where the user inputs a number, presses proceed and the form is generated. Then I need to insert the data into a table and that's where I'm lost. Here's a code snipet.. thanks in advance for your assistance!
<form action = "thispage.asp">
<input type=”text” name=”qty">
<input type="submit" value="Proceed">
<% for i = 1 to Request.Form(“qty”) %>
<table>
<tr>
<td>First Name:</td>
<td><input type=”text” name=”first_<%=i%>”></td>
etc. etc. etc……
<% next %>
<input type = “submit” name=”btnSubmit”>
<% if Request.Form(“btnSubmit”) <> “” then
for i = 1 to Request.Form(“addItem”)
sFirstName = Request.Form(“first” &i)
etc. etc.
sql = “insert into table (Firstname, etc.etc.) “ & _
“ values(“ & sFirstName & “,” etc. etc.)
objconn.execute sql
next
end if %>
<form action = "thispage.asp">
<input type=”text” name=”qty">
<input type="submit" value="Proceed">
<% for i = 1 to Request.Form(“qty”) %>
<table>
<tr>
<td>First Name:</td>
<td><input type=”text” name=”first_<%=i%>”></td>
etc. etc. etc……
<% next %>
<input type = “submit” name=”btnSubmit”>
<% if Request.Form(“btnSubmit”) <> “” then
for i = 1 to Request.Form(“addItem”)
sFirstName = Request.Form(“first” &i)
etc. etc.
sql = “insert into table (Firstname, etc.etc.) “ & _
“ values(“ & sFirstName & “,” etc. etc.)
objconn.execute sql
next
end if %>