Groups | Blog | Home
all groups > inetserver asp general > january 2005 >

inetserver asp general : Request.Form - nvacher problem...



invisibleman NO[at]SPAM nodomain.com
1/31/2005 2:35:01 AM
Thanks in advance for any help...

I have a piece of code - viewbasket.asp where variable
strProdCode and intQuant are pulled from itemsOrdered table on a
Loop from the DB (SQL Server) after they have been added, which
it does correctly...

<form action="checkout.asp" method="post" id="form1"
name="form1">

<input name="quant<%= strProdCode %>" value="<%=intQuant%>"
maxlength="2">

<input type="submit">

If you change the quantity and update - it goes to Checkout.asp
where again it loops thru and creates a variable
'quantProductCode' to see if there is a match with Request.Form
("element") and if so change it....

set rsProd = server.createobject("ADODB.Recordset")
strSQL = "select * from itemsOrdered where itemsOrdered.orderID
= " & cstr(Session("orderID"))
set rsProd = Conn.Execute(strSQL)

if rsProd.EOF and rsProd.BOF then
Session("orderID") = ""
Response.redirect "checkout.asp"
End if

rsProd.movefirst
while not rsProd.EOF
element = "quant" & rsProd("productCode")
intQuant = Request.Form("element")
response.write element & " - " & Request.Form("element")
& " - " & intQuant

if intQuant <> "" and isNumeric(intQuant) then
if intQuant = 0 then
rsProd.Delete
Session("morethangiftcert") = ""
else
rsProd("quantity") = intQuant
End if
End if

rsProd.Update
rsProd.MoveNext


The problem - this was originally set to be:
intProdID on viewbasket.asp and rsProd("productID") on
checkout.asp - integers which worked and did the change...

the new ProductCode variable is nvarchar... and does not work

if i do a response.write on both pages i can see that the
quantProductCode in both cases match - but checkout.asp doesn't
see the value quantity being passed in the form...

Any ideas of how to fix this? i'd stick to productID but i have
products in more that one table, which is necessary for what im
doing - your help is appreciated.

----------------------------------------------
Posted with NewsLeecher v2.0 Beta 5
* Binary Usenet Leeching Made Easy
* http://www.newsleecher.com/?usenet
----------------------------------------------
Ray Costanzo [MVP]
1/31/2005 9:23:25 AM
Just at quick glance, I see that you have Resquest.Form("element") instead
of Request.Form(element).

Ray at work

[quoted text, click to view]

AddThis Social Bookmark Button