jfergy
01-10-2006, 09:14 PM
Hello-
I have a form where I have mutiple lines of the same thing. Users will input a type of equipment the ID# and other minute data. Instead of creating a table and column for every line, I would like to create a new row for each line the user inputs. However, i am not sure how i can force the array to know which line goes with what data? You can see an example here:
http://www.ecinsurance.com/test/equipment.htm
any help would be appreciated. I have the following code for simple array inputs. Changes and suggestions to make what i need work would be helpful
if Request.Form <> "" then
CNumber = CNumber
office_name= Request.form("office_name")
Office_ID = Request.form("Office_ID")
Office_purchase = Request.form("Office_purchase")
Office_date = Request.form("Office_date")
Office_cost = Request.form("Office_cost")
Office_condition = Request.form("Office_condition")
MyList = Request.Form("ListID")
myArray = split(MyList,",")
For i = 0 to uBound(myArray)
strSQL = strSQL & "INSERT INTO MyTable (Cnumber, Office_Name, Office_ID, Office_Purchase, Office_Date, Office_Cost, Office_Condition) VALUES (" & CNumber & "," & myArray(i) & ");"
NEXT
GetFromDatabase strSQL
Response.Redirect"newpage.asp"
end if
I have a form where I have mutiple lines of the same thing. Users will input a type of equipment the ID# and other minute data. Instead of creating a table and column for every line, I would like to create a new row for each line the user inputs. However, i am not sure how i can force the array to know which line goes with what data? You can see an example here:
http://www.ecinsurance.com/test/equipment.htm
any help would be appreciated. I have the following code for simple array inputs. Changes and suggestions to make what i need work would be helpful
if Request.Form <> "" then
CNumber = CNumber
office_name= Request.form("office_name")
Office_ID = Request.form("Office_ID")
Office_purchase = Request.form("Office_purchase")
Office_date = Request.form("Office_date")
Office_cost = Request.form("Office_cost")
Office_condition = Request.form("Office_condition")
MyList = Request.Form("ListID")
myArray = split(MyList,",")
For i = 0 to uBound(myArray)
strSQL = strSQL & "INSERT INTO MyTable (Cnumber, Office_Name, Office_ID, Office_Purchase, Office_Date, Office_Cost, Office_Condition) VALUES (" & CNumber & "," & myArray(i) & ");"
NEXT
GetFromDatabase strSQL
Response.Redirect"newpage.asp"
end if