I have a page that uses a session variable that stores items like a shopping cart, all this works fine but i am trying to code a button that removes an item, i have a page that i have set up for the remove function and have tried the following code
this returns an error like this
this is returning an error
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'instr'
not sure where to go from here as i know nothing about this
all i want to do is click on a button on the page that will send the variable recordNum from a form on the page back to the page and remove the numbers contained in this variable
e.g.
session variable = 1,2,3,4,5,6,7,8 ,9
recordNum = 4
click the button and remove 4 so that the session variable = 1,2,3,5,6,7,8,9
hope i have explained this properly
Code:
dim firstHalf, secondHalf
firstHalf = left(session("recordsInCart"), instr(request.form("recordNum")))
secondHalf = right(session("recordsInCart"), len(session("recordsInCart")) - instr(request.form("recordNum")) - len (request.form("recordNum")))
session("recordsInCart")=firstHalf&secondHalf
this is returning an error
Microsoft VBScript runtime error '800a01c2'
Wrong number of arguments or invalid property assignment: 'instr'
not sure where to go from here as i know nothing about this
all i want to do is click on a button on the page that will send the variable recordNum from a form on the page back to the page and remove the numbers contained in this variable
e.g.
session variable = 1,2,3,4,5,6,7,8 ,9
recordNum = 4
click the button and remove 4 so that the session variable = 1,2,3,5,6,7,8,9
hope i have explained this properly
Comment