View Single Post
  #1 (permalink)  
Old Apr 30th, 2008, 16:37
natalief2008 natalief2008 is offline
New Member
Join Date: Apr 2008
Location: hull
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation 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.

Code: Select all
<%
    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

Last edited by saltedm8; May 5th, 2008 at 22:12. Reason: added [code] tags
Reply With Quote