473,396 Members | 1,756 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Dreamweaver problem passing form values with server behaviour

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:

Expand|Select|Wrap|Line Numbers
  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
  2. <% OPTION EXPLICIT %>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>Confirmation of EZ Project Update</title>
  8. </head>
  9.  
  10. <body>
  11. EZ Project Update Confirmation<br />
  12. <br />
  13. <table width="100%" height="180" border="0">
  14. <tr>
  15. <td><div align="center">
  16. <div align="left">
  17.  
  18. <%
  19. 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
  20.  
  21. ProjID = Request.form("ID")
  22. EntryDate = Request.form("EntryDate")
  23. PFIT = Request.form("PFIT_Contact")
  24. MD = Request.form("SSPA_Org")
  25. EZWS = Request.form("EZ_Strategic_Workstream")
  26. ProgrNm = Request.form("Program_Name")
  27. ProjNm = Request.form("Project_Name")
  28. ProjDescr = Request.form("ProjectDescription")
  29. WC = Request.form("Work_Category")
  30. Stat = Request.form("Status")
  31. Scop = Request.form("Scope")
  32. FDXFY = Request.form("FY")
  33. Quarter = Request.form("Qtr")
  34. CalMth = Request.form("Mth")
  35.  
  36.  
  37. 'FN = Request.form("FirstName")
  38. 'LN = Request.Form("LastName")
  39. 'EMPID = Request.Form("EmployeeID")
  40. 'EML = Request.Form("Email")
  41. Paragr1 = "TEXT HERE:"
  42. Paragr2 = "This is an automated message. Please do not respond to this email."
  43. 'Paragr3 = "TEXT FOR THIRD PARAGRAPH"
  44.  
  45. bl = " "
  46. BR = "<BR>"
  47. BK = "<BR><BR>"
  48. UND = "<u>"
  49. ENDUND = "</u>"
  50.  
  51.  
  52. 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)
  53.  
  54. Set myCDONTSMail = Server.CreateObject("CDONTS.NewMail")
  55. 'MyCDONTSMail.From = EML
  56. MyCDONTSMail.From = "myemail@home.com"
  57. MyCDONTSMail.To = "myemail@home.com"
  58. 'MyCDONTSMail.cc = "myemail@home.com"
  59. MyCDONTSMail.Subject = ":: Notice of EZ Project Update ::"
  60. 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)
  61. MyCDONTSMail.BodyFormat = 0 'this makes it HTML
  62. MyCDONTSMail.MailFormat = 0 'this makes it HTML</strong>
  63. MyCDONTSMail.Send
  64.  
  65. Set MyCDONTSMail=nothing
  66.  
  67. %>
  68.  
  69.  
  70. </div>
  71. </div>
  72. </tr>
  73. </table>
  74. </body>
  75. </html>
Any help would be greatly appreciated.

- JM
May 8 '08 #1
5 3186
DrBunchman
979 Expert 512MB
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
May 8 '08 #2
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?
May 8 '08 #3
DrBunchman
979 Expert 512MB
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:
Expand|Select|Wrap|Line Numbers
  1.  
  2. If Request("Var1") <> "" Then Session("Var1")  = Request("Var1")
  3.  
And then retrieve them on your confirmation page like so:
Expand|Select|Wrap|Line Numbers
  1.  Dim sVar1 
  2. sVar1 = Session("Var1")
  3.  
Hope this helps,

Dr B
May 9 '08 #4
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:

Expand|Select|Wrap|Line Numbers
  1. If Request("Var1") <> "" Then Session("Var1")  = Request("Var1")
  2. If Request("Var2") <> "" Then Session("Var2")  = Request("Var2")
  3. If Request("Var3") <> "" Then Session("Var3")  = Request("Var3")
On my confirmation page:

Expand|Select|Wrap|Line Numbers
  1. Dim sVar1, sVar2, sVar3
  2. sVar1 = Session("Var1")
  3. sVar2 = Session("Var2")
  4. sVar3 = Session("Var3")
May 13 '08 #5
DrBunchman
979 Expert 512MB
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
May 13 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
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...
13
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...
2
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...
171
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)...
3
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"> ...
3
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...
1
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....
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...
2
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
BarryA
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...
1
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...
0
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...
0
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...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.