Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

ASP table sending data problem

Options
  • 17-02-2004 8:47pm
    #1
    Registered Users Posts: 7,860 ✭✭✭


    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 Posts: 39,264 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