Greetings,
I have built an Update Record Form in an ASP page. This form contains a number of fields, such as text boxes and menus, to name a few.
Upon clicking the 'submit' button, I want the form values to pass to a confirmation page that shows the values entered and selected, with a CDONTS auto email generated at the same time. My problem is that I'm having trouble passing the values from the form to both the confirmation page and the auto email.
The confirmation page loads fine, and the auto email is generated. The only piece missing is passing the form values to both.
Here is the CDONTS code from my confirmation page: - <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
-
<% OPTION EXPLICIT %>
-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
<html xmlns="http://www.w3.org/1999/xhtml">
-
<head>
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-
<title>Confirmation of EZ Project Update</title>
-
</head>
-
-
<body>
-
EZ Project Update Confirmation<br />
-
<br />
-
<table width="100%" height="180" border="0">
-
<tr>
-
<td><div align="center">
-
<div align="left">
-
-
<%
-
Dim ProjID, EntryDate, PFIT, MD, EZWS, ProgrNm, ProjNm, ProjDescr, WC, Stat, Scop, FDXFY, Quarter, CalMth, FN, LN, EMPID, EML, myCDONTSMail, Paragr1, bl, Paragr2, Paragr3, BK, BR, UND, ENDUND
-
-
ProjID = Request.form("ID")
-
EntryDate = Request.form("EntryDate")
-
PFIT = Request.form("PFIT_Contact")
-
MD = Request.form("SSPA_Org")
-
EZWS = Request.form("EZ_Strategic_Workstream")
-
ProgrNm = Request.form("Program_Name")
-
ProjNm = Request.form("Project_Name")
-
ProjDescr = Request.form("ProjectDescription")
-
WC = Request.form("Work_Category")
-
Stat = Request.form("Status")
-
Scop = Request.form("Scope")
-
FDXFY = Request.form("FY")
-
Quarter = Request.form("Qtr")
-
CalMth = Request.form("Mth")
-
-
-
'FN = Request.form("FirstName")
-
'LN = Request.Form("LastName")
-
'EMPID = Request.Form("EmployeeID")
-
'EML = Request.Form("Email")
-
Paragr1 = "TEXT HERE:"
-
Paragr2 = "This is an automated message. Please do not respond to this email."
-
'Paragr3 = "TEXT FOR THIRD PARAGRAPH"
-
-
bl = " "
-
BR = "<BR>"
-
BK = "<BR><BR>"
-
UND = "<u>"
-
ENDUND = "</u>"
-
-
-
response.write Paragr1 & BK & "Project ID: " & bl & ProjID & BR & "Entry Date: " & bl & EntryDate & BR & "PFIT Contact: " & bl & PFIT & BR & "Owning SSPA MD/Mgr: " & bl & MD & BK & "EZ Strategic Workstream: " & bl & EZWS & BR & "Program Name: " & bl & ProgrNm & BR & "Project Name: " & bl & ProjNm & BR & "Project Description: " & bl & ProjDescr & BK & "Project Phase: " & bl & WC & BR & "Status: " & bl & Stat & BR & "Scope: " & bl & Scop & BK & UND & "Planning Rollout Timeline" & ENDUND & BR & "FedEx FY: " & bl & FDXFY & BR & "FedEx Fiscal Quarter: " & bl & Quarter & BR & "Calendar Month: " & bl & CalMth & BK & Paragr2 & BK & chr(13)
-
-
Set myCDONTSMail = Server.CreateObject("CDONTS.NewMail")
-
'MyCDONTSMail.From = EML
-
MyCDONTSMail.From = "myemail@home.com"
-
MyCDONTSMail.To = "myemail@home.com"
-
'MyCDONTSMail.cc = "myemail@home.com"
-
MyCDONTSMail.Subject = ":: Notice of EZ Project Update ::"
-
MyCDONTSMail.Body = Paragr1 & BK & "Project ID: " & bl & ProjID & BR & "Entry Date: " & bl & EntryDate & BR & "PFIT Contact: " & bl & PFIT & BR & "Owning SSPA MD/Mgr: " & bl & MD & BK & "EZ Strategic Workstream: " & bl & EZWS & BR & "Program Name: " & bl & ProgrNm & BR & "Project Name: " & bl & ProjNm & BR & "Project Description: " & bl & ProjDescr & BK & "Project Phase: " & bl & WC & BR & "Status: " & bl & Stat & BR & "Scope: " & bl & Scop & BK & UND & "Planning Rollout Timeline" & ENDUND & BR & "FedEx FY: " & bl & FDXFY & BR & "FedEx Fiscal Quarter: " & bl & Quarter & BR & "Calendar Month: " & bl & CalMth & BK & Paragr2 & BK & chr(13)
-
MyCDONTSMail.BodyFormat = 0 'this makes it HTML
-
MyCDONTSMail.MailFormat = 0 'this makes it HTML</strong>
-
MyCDONTSMail.Send
-
-
Set MyCDONTSMail=nothing
-
-
%>
-
-
-
</div>
-
</div>
-
</tr>
-
</table>
-
</body>
-
</html>
Any help would be greatly appreciated.
- JM
5 3186
Hi JM,
Can you confirm for me exactly what the problem is: is the data being displayed on the page correctly but not being included in your message body?
If so then the problem lies with the way you are assigning the Body property of your CDONTS mail object. The first thing you should do is change your CDONTS object, which is not used anymore, for CDOSYS. They are broadly similar and there is a good example here. You'll see there is an example which uses the HTMLBody property which you can follow to send an html formatted e-mail.
Let me know how you get on,
Dr B
Actually, the problem is that the Request.Form values from my many DIMs are not appearing in the MyCDONTSMail.Body nor the response.write portion of the page.
I'm using Dreamweaver to design the page and since my last post I understand that while request variables are the usual way of passing form data from one page to another, Dreamweaver's Insert Record, Update Record and Delete Record server behaviors will not allow this method.
Does this help?
I would still advise you to change your mail object to CDOSYS as this is the currently accepted standard.
As for the Dreamweaver problem i would suggest that you use session variables to pass data to your page. The reason that your request variables aren't being passed is because of the way the the server behaviours work. When the form is submitted, the page calls itself and then response.redirects to the intended page. This of course means the all request variables are lost between the two pages as these are not passed through a redirect.
Try something like the following on the page which you are trying to pass the variables from: -
-
If Request("Var1") <> "" Then Session("Var1") = Request("Var1")
-
And then retrieve them on your confirmation page like so: - Dim sVar1
-
sVar1 = Session("Var1")
-
Hope this helps,
Dr B
That worked, Dr. B. Thanks.
For multiple variables I want to pass between the pages, would I simply add additional lines of code?
Such as this...on the page I'm trying to pass the variables from: - If Request("Var1") <> "" Then Session("Var1") = Request("Var1")
-
If Request("Var2") <> "" Then Session("Var2") = Request("Var2")
-
If Request("Var3") <> "" Then Session("Var3") = Request("Var3")
On my confirmation page: - Dim sVar1, sVar2, sVar3
-
sVar1 = Session("Var1")
-
sVar2 = Session("Var2")
-
sVar3 = Session("Var3")
Yes i'm afraid that you'll have to do that for each variable. The only alternative would be to pass the variables as an array through the session object but to be honest I don't think it's worth it.
Glad to hear you got it working,
Dr B
Sign in to post your reply or Sign up for a free account.
Similar topics
by: John |
last post by:
Hello,
I'm working with Dreamweaver MX and we started to develop our website
with Javascript too. However, unlike "Eclipse" for Java developement
I don't have the support for Javascript code...
|
by: teddy.am |
last post by:
I know this is stupid,
but i've been trying to process a form while adding a function to the
onClick event.
as soon as i add the onClick event, the function is triggerred but the
form doesn't...
|
by: Gordon Hudson |
last post by:
Hello
Here is what I am trying to do:
Make a hyperlink on a data entry form with its URL built from the values for
fields in that entry on the database.
So, I would go to record 65785 click...
|
by: tshad |
last post by:
I am just trying to decide whether to split my code and uses code behind. I
did it with one of my pages and found it was quite a bit of trouble.
I know that most people (and books and articles)...
|
by: Andy |
last post by:
Hi,
Have just found a bug in Netscape for some of my Javascript code - works ok
in Internet Explorer. Given the following form element:
<input type="text" compulsory = "yes" name="an_el">
...
|
by: Ross McLean |
last post by:
Hi all,
I've been teaching myself C# for a new project at work. I have a bit of
a background in c++ and java but never been what you could call a guru.
I'm having some strange things happening...
|
by: Shun |
last post by:
Hello,
I have design a website using Dreamweaver 8. now the buttons which are added
in dreamweaver 8 I can't see in the Visual Studio .Net (ASP.net) rather i
can see in the browser.
2....
|
by: leeperman |
last post by:
In Dreaweaver I cannot filter my database results to display only specific data that is retrieved from mulptile drop down list on my search page. The drop down list selections are posted to my...
|
by: =?Utf-8?B?R1ROMTcwNzc3?= |
last post by:
Hi Guys,
I'm using dreamweavers login behaviour to log people in, I've managed to
manipulate it a little as I have many sites using the same database, but I'd
like to manipulate it a little...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |