Hatch
07-18-2002, 03:44 PM
I'm creating a shopping cart for bikes.
Depending on wich model of bike the users chooses dfferent parts populate check boxes for that particular model.
For example I choose model 1000.
I have a query that displays all part number for bike 1000
which looks like this
While
<input type=checkbox name=<% response.write objRS("PartNumber") %>value='on'>
Loop
<input type=checkbox name=102 value='on'>
<input type=checkbox name=741value='on'>
<input type=checkbox name=853value='on'>
<input type=checkbox name=965value='on'>
The user will check what parts he wants to order and press submit which will take them to addcart.asp.
Here is where my question comes in. How do I insert these part numbers into the database? I don't know what the partnumbers are cuz it populates itself. What value gets carried over?
Here is what I have tried in the addcart.asp
strSQL="select PartNumber from Bikes"
objRS.Open strSQL, objConn
PartNumber=request("ON")
objRS.movefirst
do until objRS.EOF
qryPartNumber = objRS("PartNumber")
if qryPartNumber = "PartNumber" then
response.write "Insert to DB"
end if
objRS.movenext
loop
But it does not work
Please Help
Thanks
Depending on wich model of bike the users chooses dfferent parts populate check boxes for that particular model.
For example I choose model 1000.
I have a query that displays all part number for bike 1000
which looks like this
While
<input type=checkbox name=<% response.write objRS("PartNumber") %>value='on'>
Loop
<input type=checkbox name=102 value='on'>
<input type=checkbox name=741value='on'>
<input type=checkbox name=853value='on'>
<input type=checkbox name=965value='on'>
The user will check what parts he wants to order and press submit which will take them to addcart.asp.
Here is where my question comes in. How do I insert these part numbers into the database? I don't know what the partnumbers are cuz it populates itself. What value gets carried over?
Here is what I have tried in the addcart.asp
strSQL="select PartNumber from Bikes"
objRS.Open strSQL, objConn
PartNumber=request("ON")
objRS.movefirst
do until objRS.EOF
qryPartNumber = objRS("PartNumber")
if qryPartNumber = "PartNumber" then
response.write "Insert to DB"
end if
objRS.movenext
loop
But it does not work
Please Help
Thanks