My form page has some dynamically listed checkboxes, all with the same name. I'm trying to insert any values that are checked into a SQL db. The problem is that it is only inserting the first of the checked boxes gets inserted. I don't get any errors.
Here's my checkbox code:
Here's the relevent action page code:
Any ideas as to why it's only inserting the first checked value?
Thanks!
Here's my checkbox code:
Code:
response.write cellstart & "<input type=""checkbox"" name=""opt"" value="""& opt_id &""" />" & opt_name & "</td>"
Here's the relevent action page code:
Code:
opt = Request.Form("opt")
aryopt = Split(opt, ",")
set con = server.createObject("ADODB.Connection")
con.open(strServerConnection)
'insert options
For x = 0 to Ubound(aryopt)
Dim sqlOpt
sqlOpt = "INSERT INTO ecom_option_match (prod_id, opt_id) VALUES ('"&prod_id&"', '"&aryopt(x)&"')"
con.execute(sqlOpt)
Next
Thanks!