View Single Post
  #1 (permalink)  
Old April 30th, 2008, 10:33 AM
natalie_2008 natalie_2008 is offline
Registered User
 
Join Date: Apr 2008
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Response.write if statements in a form?

Hope this is the correct thread to post in.
I am a student and currently studying sql, vbscript and web based databases etc.
However i am pretty much stuck on the following piece of script.

<%
    Set MyConn=Server.CreateObject("ADODB.Connection")
    MyConn.Open "pqrtrav"
    Set Rs=MyConn.Execute("SELECT*From[trip]Order by activity")
    Previousactivity="None"
    WHILE NOT Rs.EOF

    CurrentActivity=Rs("Activity")

    if (CurrentActivity<>PreviousActivity) then
%>
        <%Response.Write(Rs("Activity")) %> <input name="<%Response.Write(Rs("Activity")) %>" type="checkbox" value="<% Response.Write(Rs("Activity")) %>" >
<%
       end if
       PreviousActivity=CurrentActivity

       Rs.MoveNext

       WEND
       Rs.Close

       MyConn.Close
%>

I have opened the database and produced a list of 'activities' taken from the database with a checkbox along side it. However, when I submit the form, the information is not displayed on the next page when boxes are checked. How would it be possible to display this information on the submit page after a box has been checked??

Please help,
kind regards Natalie
Reply With Quote