Retreiving the value from previous page

Results 1 to 2 of 2

Thread: Retreiving the value from previous page

  1. #1
    Join Date
    Dec 1969

    Default Retreiving the value from previous page

    Greetings,<BR>I&#039;m working on a shopping cart and everything was working great until I decided to add this new feature, which provides the option for the user to "Add-On" addditional items to their current shopping cart. I have three "Add-on" fields, (for different items) each is a drop down box (with values 0-15). Now these add-on fiels are displayed on a page where each item that the user has selected to purchase is also displayed, which means each item will have three of these Add-on fields. I had to somehow attached the value that the user selected for that Item for that "Add-on", passed it to the next page, which updates the database with these new Add-ons for that item and display the result on this same page. <BR><BR>The problem I&#039;m running into is that these Add-on values for some reason are not always being passed to the next page and I can&#039;t figure out why. It "Sometimes" work, but not always.<BR><BR><BR>Some sample code are below:<BR><BR>set rs = Server.CreateObject("ADODB.Recordset")<BR>rs.Curso rLocation=3<BR>sqlText = "SELECT * FROM table1 WHERE ID="&ID <BR>rs.Open sqlText, Conn, adOpenDynamic,adLockPessimistic, adCmdText<BR><BR> <BR>while not rs.EOF<BR>&#039;the reason for this is because I have to distinguished, which <BR>add-on is for which item<BR>item1 = "Addon" & rs("ID") & rs("price")<BR>item2 = "Addon" & rs("ID") & rs("price")<BR>item3 = "Addon" & rs("ID") & rs("price")<BR><BR>&#039;here I passed the variable above into my "Request" to get the actual value of these fields.<BR><BR>item1 = Request(item1)<BR>item2 = Request(item2)<BR>item3 = Request(item3)<BR>rs("addon1") = item1<BR>rs("addon2") = item2<BR>rs("addon3") = item3<BR>rs.Update<BR>rs.MoveNext <BR>Wend<BR><BR>Help is greatly appreciated.<BR>Thanks,<BR>MBlast

  2. #2
    Join Date
    Dec 1969

    Default I see no evidence...

    ...of any attempt to pass the values from one page to the next.<BR><BR>I can&#039;t make any sense of this part of the code at all:<BR> item1 = "Addon" & rs("ID") & rs("price")<BR><BR>So that would end up putting something like<BR> "Addon134.95"<BR>into the variable item1. How can you tell whether that is supposed to be<BR> ID=1 and Price=34.95<BR>or<BR> ID=13 and Price = 4.95<BR>or even<BR> ID=134.9 and Price = 5<BR>???<BR><BR>In short, none of this makes any sense at all to me. <BR><BR>And you can NOT pass a variable *INTO* your "Request". Ever.<BR><BR>You can only get a value *FROM* the Request object. It&#039;s a read-only object.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts