Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

ASP table sending data problem

  • 17-02-2004 08:47PM
    #1
    Registered Users, Registered Users 2, Paid Member Posts: 8,000 ✭✭✭
    Something about sandwiches


    i am tryin to send data from a table to another page using a hyperlink ending with a "?". the problem is that i cant figure out how to send the values of my radio buttons thru the link. can anyone help? thanx


    <table border=1><tr><th><font color="#3399FF" face="Atlantis">prodno</th><th><font color="#3399FF" face="Atlantis">colours available</font></th><th><font color="#3399FF" face="Atlantis">pic</font></th><th><font color="#3399FF" face="Atlantis">size</font></th><th><font color="#3399FF" face="Atlantis">type</font></th><th><font color="#3399FF" face="Atlantis">Options</font></th></tr>
    <% do while not ResultVariable.EOF %>

    <tr>
    <td><font color="#3399FF" face="Atlantis"><%=ResultVariable(0)%></font></td>

    <td><font color="#3399FF" face="Atlantis">
    Red <input type=radio value=red name=colour><br>
    Green<input type=radio value=green name=colour><br>
    Blue <input type=radio value=blue name=colour><br>
    </font></td>

    <td><font color="#3399FF" face="Atlantis"><img src="<%=ResultVariable(2)%>"></font></td>

    <td><font color="#3399FF" face="Atlantis">
    Small<input type=radio value=small name=size><br>
    Med <input type=radio value=med name=size><br>
    Large<input type=radio value=large name=size><br>
    </font></td>
    <%
    Set size=size.value
    %>
    <td><font color="#3399FF" face="Atlantis"><%=ResultVariable(4)%></font></td>
    <td><font color="#3399FF" face="Atlantis">

    <a href=shopping.asp?sex=women&prodno=<%=ResultVariable(0)%>&colour=<%="'" & colour & "'"%>&size=>Add to cart</a></tr>

    <%
    ResultVariable.MoveNext
    ' move to the next row in the data set
    loop
    ' goto the next itteration of the while loop
    ResultVariable.Close
    Conntemp.Close
    %>

    </table>


Comments

  • Moderators, Politics Moderators, Paid Member Posts: 44,081 Mod ✭✭✭✭Seth Brundle


    just have the form (which doesn't appear to exist yet) got to update_cart.asp (not sure what your shopping.asp does) as follows:-

    <table border=1><tr><th><font color="#3399FF" face="Atlantis">prodno</th><th><font color="#3399FF" face="Atlantis">colours available</font></th><th><font color="#3399FF" face="Atlantis">pic</font></th><th><font color="#3399FF" face="Atlantis">size</font></th><th><font color="#3399FF" face="Atlantis">type</font></th><th><font color="#3399FF" face="Atlantis">Options</font></th></tr>
    </TABLE>

    <% do while not ResultVariable.EOF %>
    <FORM METHOD="get" ACTION="update_cart.asp">

    <table border=1>
    <tr>
    <td><font color="#3399FF" face="Atlantis"><%=ResultVariable(0)%></font></td>

    <td><font color="#3399FF" face="Atlantis">
    Red <input type=radio value=red name=colour><br>
    Green<input type=radio value=green name=colour><br>
    Blue <input type=radio value=blue name=colour><br>
    </font></td>

    <td><font color="#3399FF" face="Atlantis"><img src="<% = ResultVariable(2)%>"></font></td>

    <td><font color="#3399FF" face="Atlantis">
    Small<input type=radio value=small name=size><br>
    Med <input type=radio value=med name=size><br>
    Large<input type=radio value=large name=size><br>
    </font></td>

    <td><font color="#3399FF" face="Atlantis"><%=ResultVariable(4)%></font></td>
    <td><font color="#3399FF" face="Atlantis">
    <INPUT TYPE="submit" VALUE="update cart">
    <INPUT TYPE="hidden" NAME="sex" VALUE="women" >
    <INPUT TYPE="hidden" NAME="prodno" VALUE="=<%=ResultVariable(0)%>">
    </FONT>
    </tr>
    </table>
    </FORM>
    <%
    ResultVariable.MoveNext
    ' move to the next row in the data set
    loop
    ' goto the next itteration of the while loop
    ResultVariable.Close
    Conntemp.Close
    %>


    ps lose the font tags!


Advertisement