S
Simon
Hey folks,
I need some of your expertiese again. I am creating a survey form and need
some help gathering the results of a question that has checkboxes. There
are four options for one of the questions for example
Where do you normally buy books?
o Bookstore
o Online
o Book club
o Other
I'm going to store the answers in a DB and I dont want to have have four
fields if only two of them are going to get used. Im trying to find a GOOD
way to collect the results perhaps in an array or comma seperated list so I
could store it in onefield.
Right now here is what I have
<%
strBuyBook1 = Trim(Request.Form("buy_book1"))
strBuyBook2 = Trim(Request.Form("buy_book2"))
strBuyBook3 = Trim(Request.Form("buy_book3"))
strBuyBook4 = Trim(Request.Form("buy_book4"))
Connect to the database
call OpenDB()
SQL = "INSERT INTO tblAnswers( BuyBook1, BuyBook2, BuyBook3, BuyBook4)" & _
"VALUES ('" & strBuyBook1 & "', '" & strBuyBook2 & "', '" &
strBuyBook3 & "', '" & strBuyBook4 & "')"
con.Execute SQL
%>
Thanks in anticipation
Simon
I need some of your expertiese again. I am creating a survey form and need
some help gathering the results of a question that has checkboxes. There
are four options for one of the questions for example
Where do you normally buy books?
o Bookstore
o Online
o Book club
o Other
I'm going to store the answers in a DB and I dont want to have have four
fields if only two of them are going to get used. Im trying to find a GOOD
way to collect the results perhaps in an array or comma seperated list so I
could store it in onefield.
Right now here is what I have
<%
strBuyBook1 = Trim(Request.Form("buy_book1"))
strBuyBook2 = Trim(Request.Form("buy_book2"))
strBuyBook3 = Trim(Request.Form("buy_book3"))
strBuyBook4 = Trim(Request.Form("buy_book4"))
Connect to the database
call OpenDB()
SQL = "INSERT INTO tblAnswers( BuyBook1, BuyBook2, BuyBook3, BuyBook4)" & _
"VALUES ('" & strBuyBook1 & "', '" & strBuyBook2 & "', '" &
strBuyBook3 & "', '" & strBuyBook4 & "')"
con.Execute SQL
%>
Thanks in anticipation
Simon