Shilohcity
Technical User
Hi there
I am new to asp and have the following problem:
I am trying to sort out a page which displays the contents of a table from a database and gives the option of selecting certain items (for shopping purposes). This is fine but the page which processes this information has me stumped. I am having trouble getting the script to recognise whether an item is selected or not as the information is being forwarded as a string. When I break down the selection info into a separated array it gets a little better but is still taking all of the information in the table instead of the selected records. I guess basically I need to figure out how to uniquely identify the records, keep them as separate records when displayed and pass this information to a new table
Dim objRS, stritemselect, arritemselect, sepitemselect, itemselect
'gather itemselect status and separate up
stritemselect = Request.Form("itemselect"
arritemselect = Split (stritemselect, ",", -1, 1)
For Each sepitemselect in arritemselect
Response.Write sepitemselect
Set objRS=Server.CreateObject("ADODB.Recordset"
objRS.Open "iteminfo",objConn,,adLockOptimistic, adCmdTable
Do While Not objRS.EOF
Response.Write objRS("itemprice"
Response.Write objRS("itemtype"
objRS.Update
objRS.MoveFirst
Loop
Response.Write ("<BR>"
Next
'if itemselect is positive then write to itemorder table
For itemselect = LBound(arritemselect) to UBound(arritemselect)
Set objRS=Server.CreateObject("ADODB.Recordset"
objRS.Open "itemorder",objConn,,adLockOptimistic, adCmdTable
objRS.AddNew
objRS("itemselect" = Request.Form("itemselect"
objRS("itemid" = Request.Form("itemid"
objRS("itemtype" = Request.Form("itemtype"
objRS("itemcolour" = Request.Form("itemcolour"
objRS("itemsize" = Request.Form("itemsize"
objRS("itemprice" = Request.Form("itemprice"
objRS.Update
objRS.MoveFirst
I am new to asp and have the following problem:
I am trying to sort out a page which displays the contents of a table from a database and gives the option of selecting certain items (for shopping purposes). This is fine but the page which processes this information has me stumped. I am having trouble getting the script to recognise whether an item is selected or not as the information is being forwarded as a string. When I break down the selection info into a separated array it gets a little better but is still taking all of the information in the table instead of the selected records. I guess basically I need to figure out how to uniquely identify the records, keep them as separate records when displayed and pass this information to a new table
Dim objRS, stritemselect, arritemselect, sepitemselect, itemselect
'gather itemselect status and separate up
stritemselect = Request.Form("itemselect"
arritemselect = Split (stritemselect, ",", -1, 1)
For Each sepitemselect in arritemselect
Response.Write sepitemselect
Set objRS=Server.CreateObject("ADODB.Recordset"
objRS.Open "iteminfo",objConn,,adLockOptimistic, adCmdTable
Do While Not objRS.EOF
Response.Write objRS("itemprice"
Response.Write objRS("itemtype"
objRS.Update
objRS.MoveFirst
Loop
Response.Write ("<BR>"
Next
'if itemselect is positive then write to itemorder table
For itemselect = LBound(arritemselect) to UBound(arritemselect)
Set objRS=Server.CreateObject("ADODB.Recordset"
objRS.Open "itemorder",objConn,,adLockOptimistic, adCmdTable
objRS.AddNew
objRS("itemselect" = Request.Form("itemselect"
objRS("itemid" = Request.Form("itemid"
objRS("itemtype" = Request.Form("itemtype"
objRS("itemcolour" = Request.Form("itemcolour"
objRS("itemsize" = Request.Form("itemsize"
objRS("itemprice" = Request.Form("itemprice"
objRS.Update
objRS.MoveFirst