#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Oslo
    Posts
    4
    Rep Power
    0

    Passing checkbox value to other asp page


    I have a simple problem:

    page 1:
    <input type=checkbox name=addValue value="Y">

    page 2:
    <input type="hidden" name="addValue" value="<%=Y%>">

    page3:
    <%=request.form("addValue")%>
    <%if "addValue" = "Y" then addTax="30,00" else addTax="0,00" end if%>
    <%=pCurrencySign & (addTax)%>

    There is a problem in transfering the value from page 1 to page 2 and 3. What is the problem here???
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12
    ASP is different from the way PHP or Perl work.
    page 2:
    <input type="hidden" name="addValue" value="<%=Y%>">
    Should be

    page 2:
    <input type="hidden" name="addValue" value="<%=Request("AddValue")%>">

    Similar to what you did in page 3
    I hope this is of any help to anyone.

    Yassoor
    http://www.WebsitesCreation.ca
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Oslo
    Posts
    4
    Rep Power
    0

    Unhappy


    <input type="hidden" name="addValue" value="">

    as you can see, if I look into view source in second page, value have not been transffered if I use your code.

    Any idea???
  6. #4
  7. No Profile Picture
    Overly white
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Fresno, CA
    Posts
    83
    Rep Power
    12
    page3:
    <%=request.form("addValue")%>
    Do just like you did on page 3.
    Code:
    <input type="hidden" name="addValue" value="<%=request.form("addValue")%>">
    That should do it for you.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2002
    Location
    Oslo
    Posts
    4
    Rep Power
    0
    How to write this using sessions only???
  10. #6
  11. No Profile Picture
    Overly white
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Fresno, CA
    Posts
    83
    Rep Power
    12
    Umm I'm not sure what you mean. Maybe this is what you are looking for:
    Code:
    <input type="hidden" name="addValue" value="<%=Session("addValue")%>">
    Session("NAME") works the same as any variable. Session("NAME") = "blah foo bar blah" sets it, and X= Session("Name") sets X = to it.

IMN logo majestic logo threadwatch logo seochat tools logo