Wrox Programmer Forums
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 17th, 2004, 10:56 AM
Authorized User
Join Date: Jul 2004
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Night_Zero
Default Submit Button

I need to make this submit button work in the form. I want test.asp to display a page with all the check boxes and then have a submit button. After you hit the submit button on that page it redirects you to success.asp that tells you which emails it sent too. If you take out the code in the first <% %> and the submit button code that is commented out it displays all the names correctly and check boxes but I can't get the submit to work. I keep getting the error about an expected statement on that line or on one around. I believe that the email part itself redirects you to success.asp so all that the submit needs to do is actually execute the email code but I can't get it to do that. After the submit works this program will finally be done. Help please...

<%Option Explicit%>
<TITLE>Password Updater</TITLE>
        if request(Send) = Send Then
        Dim arrEmails, strSelectedDetails, objMail
        strSelectedDetails = Request.Form("chkEmails")

            If len(trim(strSelectedDetails))>0 then
            Set objMail = Server.CreateObject("CDONTS.NewMail")
            arrEmails = Split(strSelectedDetails)
                for j=0 to Ubound(arrEmails)
                objMail.From= "data@hidden.com"
                objMail.Subject= "Password Change"
                objMail.Body= "Your online and FTP password has now expired. Please update your records to reflect the following login and new password: "<br>" "<br>" Login: " & strLogin & " "<br>" Password: " & strPassword & ". Attached you will find instructions for changing your password if you use CoffeeCup Free FTP. If you are using a different FTP client software, please consult your MIS department for assistance. "<br>" If you have any questions, please feel free to contact our Client Service Team at hidden. "<br>"Thank you! "<br>" Data Services "<br>" Hidden "<br>" hidden "
                objMail.AttachFile server.mappath("Changing-Passwords-in-CoffeeCup-Free-FTP.pdf")
        Set objMail = nothing
            Response.Redirect("Success.asp?MailSentTo=" & strSelectedDetails)
                Response.Write "No Selection made for sending emails"
        End If
    End If

    dim cn, sql, rs
    Set cn = CreateObject("ADODB.Connection")

    cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
        "Data Source=c:\inetpub\database\ftp.mdb;" & _
        "Jet OLEDB:System Database=\\matrix\database\dent32\dent32.mdw" , _
        "Hidden", "Hidden"

    set rs = server.createobject("adodb.recordset")
              "WHERE (((PASSWORD.IsCurrent)=-1) AND ((PASSWORD.Assigned)=#4/16/04#) AND ((PASSWORD.ID)=[CLIENT_CONTACTS].[CLIENT ID] And (PASSWORD.ID)=[CLIENT].[CLIENT ID]));"

    response.write("<h3>Check the check box if you would like to email the client his or her password then hit send</h3>")

    rs.Open sql, cn

    Response.write "<form name='frm1' action='test.asp' method='post'>"
        while not rs.eof
                Response.write "<input type='checkbox' name='chkEmails' value='" & rs("CONTACT EMAIL") & "_" & rs("CLIENT NAME") & "_" & rs("Password") & "_" & rs("ID") & "'>"
            response.write rs("ClIENT NAME") & " " & " "
        response.write rs("ID") & " " & "<br>"
        response.write rs("CONTACT EMAIL") & "<br>" & "<br>"

'SUBMIT BUTTON CODE <input type="submit" value="Send" name="Send">

        Response.write "</form>"

        set rs = nothing


Old August 17th, 2004, 04:55 PM
Friend of Wrox
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

hmm.. Initiated on the other thread?:) In a way, it is nice to see the page fit into the screen.

Okay, You made 2 mistakes there...

1) Change it as this.
if request("Send") = "Send" Then
2) Use a Response.write here, as that part of code goes within <% %>
Response.write "<input type='submit' value='Send' name='Send'>"
Hope this helps and lets you finish it on time.

- Vijay G
Strive for Perfection

Similar Threads
Thread Thread Starter Forum Replies Last Post
Submit button not fired. r_taduri ASP.NET 2.0 Professional 1 August 30th, 2006 12:51 AM
Make a image button as default submit button toshi ASP.NET 1.0 and 1.1 Basics 1 June 1st, 2006 05:25 AM
Submit Button trusslady Infopath 2 January 6th, 2006 05:19 PM
submit-button grstad Javascript How-To 1 May 25th, 2005 08:33 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.