Well, what it is that I am trying to accomplish is: The user goes to a form,
fills out whatever needs to be changed and only the changes that they make
are then emailed to the webmaster.
So, the code that I have been having trouble with is all on the page that is
called after the user submits their changes. The page looks like this
(codewise):
<html>
<head>
<title>SubmitChangeMail</title>
</head>
<cfquery datasource="FirmDaily" name="GetOld">
Select * from Employees where ID = #ID#
</cfquery>
<cfif GetOld.Salutation IS NOT '#Salutation#'>
<cfset chgSalutation = #Salutation#>
<cfelse>
<cfset chgSalutation = "">
</cfif>
<cfif GetOld.Firstname IS NOT '#FirstName#'>
<cfset chgFirstName = #FirstName#>
<cfelse>
<cfset chgFirstname = "">
</cfif>
<cfif GetOld.lastname IS NOT '#lastName#'>
<cfset chglastName = #lastName#>
<cfelse>
<cfset chgLastName = "">
</cfif>
<cfif GetOld.middlename IS NOT '#middleName#'>
<cfset chgMiddleName = #MiddleName#>
<cfelse>
<cfset chgMiddleName = "">
</cfif>
<cfif GetOld.Nickname IS NOT '#NickName#'>
<cfset chgnickName = #NickName#>
<cfelse>
<cfset chgNickName = "">
</cfif>
<cfif GetOld.Ext IS NOT '#Ext#'>
<cfset chgExt = #Ext#>
<cfelse>
<cfset chgExt = "">
</cfif>
<cfif GetOld.Worksfor IS NOT '#Worksfor#'>
<cfset chgWorksfor = #Worksfor#>
<cfelse>
<cfset chgWorksfor = "">
</cfif>
<cfif GetOld.SecExt IS NOT '#SecExt#'>
<cfset chgSecExt = #SecExt#>
<cfelse>
<cfset chgSecExt = "">
</cfif>
<cfif GetOld.SecBackup IS NOT '#SecBackup#'>
<cfset chgSecBackup = #SecBackup#>
<cfelse>
<cfset chgSecBackup = "">
</cfif>
<cfif GetOld.Title IS NOT '#Title#'>
<cfset chgTitle = #Title#>
<cfelse>
<cfset chgTitle = "">
</cfif>
<cfif GetOld.Office IS NOT '#Office#'>
<cfset chgOffice = #Office#>
<cfelse>
<cfset chgOffice = "">
</cfif>
<cfif GetOld.Floor IS NOT '#Floor#'>
<cfset chgFloor = #Floor#>
<cfelse>
<cfset chgFloor = "">
</cfif>
<cfif GetOld.ExternalEmail IS NOT '#ExternalEmail#'>
<cfset chgExternalEmail = #ExternalEmail#>
<cfelse>
<cfset chgExternalEmail = "">
</cfif>
<cfif GetOld.Room IS NOT '#Room#'>
<cfset chgRoom = #Room#>
<cfelse>
<cfset chgRoom = "">
</cfif>
<cfif GetOld.Birthdate IS NOT '#Dateformat(Birthdate, "MM/DD/YYYY")#'>
<cfset chgBirthdate = #Dateformat(Birthdate, "MM/DD/YYYY")#>
<cfelse>
<cfset chgBirthdate = "">
</cfif>
<cfif GetOld.Anniversary IS NOT '#Anniversary#'>
<cfset chgAnniversary = #Anniversary#>
<cfelse>
<cfset chgAnniversary = "">
</cfif>
<cfif GetOld.Barno IS NOT '#Barno#'>
<cfset chgBarno = #Barno#>
<cfelse>
<cfset chgBarNo = "">
</cfif>
<cfif GetOld.AttyBillingNo IS NOT '#AttyBillingNo#'>
<cfset chgAttyBillingNo = #AttyBillingNo#>
<cfelse>
<cfset chgAttyBillingNo = "">
</cfif>
<cfif GetOld.CAFNo IS NOT '#CAFNo#'>
<cfset chgCAFNo = #CAFNo#>
<cfelse>
<cfset chgCAFNo = "">
</cfif>
<cfif GetOld.Unlisted IS NOT '#Unlisted#'>
<cfset chgUnlisted = #Unlisted#>
<cfelse>
<cfset chgUnlisted = "">
</cfif>
<cfif GetOld.HomePhone IS NOT '#HomePhone#'>
<cfset chgHomePhone = #HomePhone#>
<cfelse>
<cfset chgHomePhone = "">
</cfif>
<cfif GetOld.HomeAddress IS NOT '#HomeAddress#'>
<cfset chgHomeAddress = #HomeAddress#>
<cfelse>
<cfset chgHomeAddress = "">
</cfif>
<cfif GetOld.Spouse IS NOT '#Spouse#'>
<cfset chgSpouse = #Spouse#>
<cfelse>
<cfset chgSpouse = "">
</cfif>
<cfif IsDefined("GetOld.FLanaguage") and GetOld.FLanaguage IS "">
<cfset chgFLanguage = "">
<cfelseif IsDefined("GetOld.FLanaguage") and GetOld.FLanguage IS NOT
'#FLanguage#'>
<cfset chgFLanguage = #FLanguage#>
</cfif>
<body>
<!--- [EMAIL PROTECTED]; [EMAIL PROTECTED];
[EMAIL PROTECTED] --->
<cfmail to="[EMAIL PROTECTED]" from="[EMAIL PROTECTED]"
subject="Firm Directory Change Request" type="HTML">
<h4>An employee has requested that a change be made to the firm
directory.</h4>
<table>
<tr>
<td><b>Change Requested by:</b></td>
<td>#Firstname# #Middlename# #Lastname#</td>
</tr>
<cfif #chgSalutation# is not "">
<tr>
<td><b>Salutation Change:</b></td>
<td>#chgSalutation#</td>
</tr>
</cfif>
<cfif #chgFirstName# is not "">
<tr>
<td><b>First Name Change:</b></td>
<td>#chgFirstName#</td>
</tr>
</cfif>
<cfif #chgMiddleName# is not "">
<tr>
<td><b>Middle Name Change:</b></td>
<td>#chgMiddleName#</td>
</tr>
</cfif>
<cfif #chgLastName# is not "">
<tr>
<td><b>Last Name Change:</b></td>
<td>#chgLastName#</td>
</tr>
</cfif>
<cfif #chgNickName# is not "">
<tr>
<td><b>Nick Name Change:</b></td>
<td>#chgNickName#</td>
</tr>
</cfif>
<cfif #chgExt# is not "">
<tr>
<td><b>Extention Change:</b></td>
<td>#chgExt#</td>
</tr>
</cfif>
<cfif #chgWorksfor# is not "">
<tr>
<td><b>Works for/Secretary Change:</b></td>
<td>#chgWorksfor#</td>
</tr>
</cfif>
<cfif #chgSecExt# is not "">
<tr>
<td><b>Secretary's Extention Change:</b></td>
<td>#chgSecExt#</td>
</tr>
</cfif>
<cfif #chgSecBackup# is not "">
<tr>
<td><b>Secretary Backup Change:</b></td>
<td>#chgSecBackup#</td>
</tr>
</cfif>
<cfif #chgTitle# is not "">
<tr>
<td><b>Title Change:</b></td>
<td>#chgTitle#</td>
</tr>
</cfif>
<cfif #chgOffice# is not "">
<tr>
<td><b>Office Change:</b></td>
<td>#chgOffice#</td>
</tr>
</cfif>
<cfif #chgFloor# is not "">
<tr>
<td><b>Floor Change:</b></td>
<td>#chgFloor#</td>
</tr>
</cfif>
<cfif #chgRoom# is not "">
<tr>
<td><b>Room Change:</b></td>
<td>#chgRoom#</td>
</tr>
</cfif>
<cfif #chgExternalEmail# is not "">
<tr>
<td><b>Email Address Change:</b></td>
<td>#chgExternalEmail#</td>
</tr>
</cfif>
<cfif #chgBirthdate# is not "">
<tr>
<td><b>Birthdate Change:</b></td>
<td>#chgBirthdate#</td>
</tr>
</cfif>
<cfif #chgAnniversary# is not "">
<tr>
<td><b>Anniversary Change:</b></td>
<td>#chgAnniversary#</td>
</tr>
</cfif>
<cfif #chgBarno# is not "">
<tr>
<td><b>Barno Change:</b></td>
<td>#chgBarno#</td>
</tr>
</cfif>
<cfif #chgAttyBillingNo# is not "">
<tr>
<td><b>Timekeeper No. Change:</b></td>
<td>#chgAttyBillingNo#</td>
</tr>
</cfif>
<cfif #chgCAFNo# is not "">
<tr>
<td><b>CAF No. Change:</b></td>
<td>#chgCAFNo#</td>
</tr>
</cfif>
<cfif #chgUnlisted# is not "">
<tr>
<td><b>Unlisted Change:</b></td>
<td>#chgUnlisted#</td>
</tr>
</cfif>
<cfif #chgHomePhone# is not "">
<tr>
<td><b>Home Phone Change:</b></td>
<td>#chgHomePhone#</td>
</tr>
</cfif>
<cfif #chgHomeAddress# is not "">
<tr>
<td><b>Home Address Change:</b></td>
<td>#chgHomeAddress#</td>
</tr>
</cfif>
<cfif #chgSpouse# is not "">
<tr>
<td><b>Spouse Change:</b></td>
<td>#chgSpouse#</td>
</tr>
</cfif>
<cfif IsDefined("chgFLanguage") and chgFLanguage IS NOT "">
<tr>
<td><b>Foriegn Language Change:</b></td>
<td>#chgFLanguage#</td>
</tr>
</cfif>
</table>
</cfmail>
<cflocation url="http://DailyNews">
</body>
</html>
Does this help?
Thanks,
Aimee'
-----Original Message-----
From: Everett, Al [mailto:AEverett@;askallied.com]
Sent: Thursday, October 31, 2002 2:45 PM
To: CF-Talk
Subject: RE: Need assistance with listbox on a form
You should explicitly scope your variables, i.e., Form.chgFLanguage or
queryname.chgFLanguage. That may be contributing to the problem.
We also need to see the bigger picture. What is it you're trying to
accomplish?
> -----Original Message-----
> From: Clark, Aimee [mailto:aclark@;stinsonmoheck.com]
> Sent: Thursday, October 31, 2002 3:23 PM
> To: CF-Talk
> Subject: RE: Need assistance with listbox on a form
>
>
> I'm sorry, but that gives me an error right where the
> #chgFLanguage# line
> is.
>
> I have tried the len(chgFLangauge) suggestion that Shawn
> provided, but that
> did not work either.
>
> I tried this and it at least allowed for me to modify
> something other than
> the list box, but now if I choose a foreign language, it
> doesn't pass the
> value I selected to the email that is generated.
>
> <cfif IsDefined("chgFLanguage") and chgFLanguage IS NOT "">
> <tr>
> <td><b>Foriegn Language Change:</b></td>
> <td>#chgFLanguage#</td>
> </tr>
> </cfif>
>
> Boy, am I trouble or what?
>
> -----Original Message-----
> From: Tony Weeg [mailto:tony@;navtrak.net]
> Sent: Thursday, October 31, 2002 2:21 PM
> To: CF-Talk
> Subject: RE: Need assistance with listbox on a form
>
>
> aimee,
>
> try this....
>
> <cfif NOT isDefined("chgFlanguage")>
> <tr>
> <td><b>Foriegn Language Change:</b></td>
> <td>#chgFLanguage#</td>
> </tr>
> </cfif>
>
> .tony
>
> Tony Weeg
> Senior Web Developer
> Information System Design
> Navtrak, Inc.
> Fleet Management Solutions
> www.navtrak.net
> 410.548.2337
>
>
> -----Original Message-----
> From: Clark, Aimee [mailto:aclark@;stinsonmoheck.com]
> Sent: Thursday, October 31, 2002 3:04 PM
> To: CF-Talk
> Subject: RE: Need assistance with listbox on a form
>
>
> So, for some reason my last email was cut off. Here is the code that I
> am
> trying to process from my previous problem.
>
> Here is the code that is processing:
>
> <cfif #chgFLanguage# is not "">
> <tr>
> <td><b>Foriegn Language Change:</b></td>
> <td>#chgFLanguage#</td>
> </tr>
> </cfif>
>
> How do I correct this?
>
> Thanks,
>
> Aimee'
>
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.