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

    Join Date
    Feb 2003
    Posts
    6
    Rep Power
    0

    Passing ASP via hidden form fields....


    Hi

    I want to pass ASP returned values via hidden form fields...

    Here is a simpler demo of my what I am trying to do....

    Page containg asp values in hidden fields of a form:
    (input.asp)
    <html>
    <body>
    <form method = "post" action="ad.asp">
    <input type = "hidden" value = "adski" name = "ad1">
    <input type = "hidden" value = ""<%= WeekDayName(Weekday(Date)) %>"" name="ad2">
    <input type = "submit" value="submit" name = "submit">
    </body>
    </html>


    Output page, showing passed ASP values:
    (ad.asp)
    <%
    Option Explicit
    response.buffer = true
    %>
    <html>
    <body>
    <%
    ' declare all variable names
    dim ad1
    dim ad2
    ad1 = request.form("ad1")
    ad2 = request.form("ad2")
    %>

    this is ad2:<br>
    <%response.write ad1%>
    <br>
    <br>
    this is ad1:<br>
    <%response.write ad2%>
    </body>
    </html>

    But on ad.asp i only pass the text value, not the asp value of the second hidden field.!!!!!

    How can I do it'????
    Any ideas?

    muchos gracias for your help!

    Comments on this post

    • BaronVonDoppleG agrees
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    6
    Rep Power
    0
    DoH! sussed it out!! too many """"""

    Doh!

    Ciao!
  4. #3
  5. No Profile Picture
    Techincal Developer
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    New Delhi India
    Posts
    12
    Rep Power
    0

    Lightbulb hi, here is an error in u'r code


    hi
    here is u'r code
    ---------------------------------------------
    <input type = "hidden" value = ""<%= WeekDayName(Weekday(Date)) %>"" name="ad2">
    ---------------------------------------------

    the right code is
    =================
    <%
    dim week_dy
    weel_dy=WeekDayName(Weekday(Date))
    %>
    <input type = "hidden" value = "<%=week_dy%>" name="ad2">
    =================
    u just have to copy the above code and paste in place of u'r 2nd hidden element.
    nothing else and u got the right result on ad.asp page
    feel free to ask any other query.....
    bye
    Sur

    Comments on this post

    • BaronVonDoppleG agrees
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12

    !?


    Adam, I am not sure if the last reply answered your question, but what exactly r u trying to do?!

    I noticed that you used double doubl quotes "" <%=Wee....%>"".

    If you could explain more on what do u mean u r getting the text not the asp output.

    Comments on this post

    • BaronVonDoppleG agrees
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Location
    Canada - Egypt
    Posts
    60
    Rep Power
    12
    if what you ment was the output of the ad.asp page be like

    as is

    ===============

    adski
    <%=WeekDayName(Weekday(Date)) %>

    ===============

    Then in the input
    <input type = "hidden" value = "&lt;%= WeekDayName(Weekday(Date)) %&gt;" name="ad2">


    &lt; and &gt; instead of the <% and the %>

    I hope this is of any help

    Yasser
    http://www.websitescreation.ca

IMN logo majestic logo threadwatch logo seochat tools logo