Hello experts,
I need a hand. On my asp submit page I have the following code:
Note: just the bulk of the code has been added so that you get an idea
of what it is that I am talking about.
On my html form I have a combination of dropdownlists and combo
boxes. The checkboxes all have the same name. It is basically 1
question checkbox with the ability to choose 5 answers. I have a
total of 5 questions(1 checkbox question and 3 drop downs and 1
textbox. What I am struggling with is how do I get the answers from
the checkboxes into the database as well as the other form elements.
If it is much easier to not parse the comma separated list then so be
it Thanks everyone.
I need a hand. On my asp submit page I have the following code:
Code:
for i = 1 to 5 ' 5 question form'
Question = Request.Form("Q" & i)
Answer = Request.Form("A" & i)
Comment = Request.Form("C" & i )
ValComment = Replace(Comment, "'", "''")
ValAnswer = Replace(Answer, "'", "''")
checkbox = Request.Form("check")
checkbox = Split(checkbox,", ")
-----------------------------------------------------------------------------------------
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "removed for security reasons"
set sSQL = server.CreateObject ("ADODB.Recordset")
set sSQL1 = server.CreateObject ("ADODB.Recordset")
--------------------------------------------------------------------------------------------
IF........somthing here in the checkbox = STRUGGLING HERE please help
sSQL = "INSERT into Table (ID, Question, Answer, Comments, TimeStamp,
UserID)"
sSQL = sSQL & "VALUES (Test_seq.nextval, '" & Question &"', '" &
checkbox &"', '" & ValComment &"', sysdate, '"& User & "')"
Else
sSQL1 = "INSERT into table (ID, Question, Answer, Comments, TimeStamp,
UserID)"
sSQL1 = sSQL1 & "VALUES (Test_seq.nextval, '" & Question &"', '" &
ValAnswer &"', '" & ValComment &"', sysdate, '"& User & "')"
response.write ssql1 & "<BR>"
End IF
Next
response.end
Note: just the bulk of the code has been added so that you get an idea
of what it is that I am talking about.
On my html form I have a combination of dropdownlists and combo
boxes. The checkboxes all have the same name. It is basically 1
question checkbox with the ability to choose 5 answers. I have a
total of 5 questions(1 checkbox question and 3 drop downs and 1
textbox. What I am struggling with is how do I get the answers from
the checkboxes into the database as well as the other form elements.
If it is much easier to not parse the comma separated list then so be
it Thanks everyone.