Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 July 9th, 2003, 12:14 PM
Authorized User
 
Join Date: Jul 2003
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default Updating database before submitting form

I have a form that must be submitted by POST method to a CGI page, but I first need to post some of the form content to an ASP database. Is it possible to invoke ASP code with an "onsubmit=" within a FORM?

 
Old July 10th, 2003, 08:38 AM
Authorized User
 
Join Date: Jul 2003
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default

Would not the easiest way be to send your data to the next page and do your insert command in your <head> area so it happens before the new page is processed? At least this is the way I would handle it.

 
Old July 17th, 2003, 06:58 AM
Registered User
 
Join Date: Jul 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to tyson Send a message via MSN to tyson
Default

I am new to all of this but i thought i would ask I made this form that starts off with collecting information from someone like an email then it send s the info to a asp page and it says thank you with the name of the person emailing then how do i get the information to come to me in a a email i am lost please help

 
Old July 17th, 2003, 12:43 PM
Authorized User
 
Join Date: Jul 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Tyson, This what worked for me.
in my main page
<FORM ACTION="submitform.asp" Method="Post" >
<INPUT TYPE="hidden" NAME="FormName" VALUE="NameofMainPage.asp">
<INPUT TYPE="hidden" NAME="subject" VALUE="Subject">
<INPUT TYPE="hidden" NAME="SendTo" VALUE="[email protected]">
.
.
.
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="Send Now!">
</FORM>

then you make a submitform.asp page:

<%
Const strHTTP = "http://folder location"

strDate = Now()

    'get form info
    strFormName = Request("FormName")
    strSubject = Request("subject")
    strSendTo = Request("SendTo")

strHTML = "<HTML> <HEAD> <TITLE></TITLE> </HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "<TABLE WIDTH=600 CELLPADDING=""0"" CELLSPACING=""0"">"
strHTML = strHTML & "<TR><TD COLSPAN=3 ALIGN=CENTER></TD>"
strHTML = strHTML & "</TR>"

'time to send the email
    Dim objCDO
    Set objCDO = Server.CreateObject("CDONTS.NewMail")

    objCDO.To = strSendTo
    objCDO.From = strNumber
    objCDO.Subject = strSubject
    objCDO.BodyFormat = 0
    objCDO.MailFormat = 0
    objCDO.Body = strHTML
    objCDO.Send

    set objCDO = nothing

    'redirect to the "Thanks" page
    Response.Redirect strHTTP & "submitdone.htm"
%>

in the strHTML you can specify the format on how you want it emaild works great...

hope this helps, email me directly if you need more help






Similar Threads
Thread Thread Starter Forum Replies Last Post
Submitting a form to a database nvillare Classic ASP Basics 2 January 27th, 2005 06:38 PM
Form Submitting cro_crx Beginning PHP 3 January 17th, 2005 01:30 PM
Submitting a form YuliaKupina Classic ASP Basics 3 June 24th, 2004 01:52 AM
ASP code to update database on submitting form? kkbigal Classic ASP Databases 3 July 14th, 2003 05:55 AM





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