Ask a Question related to Coldfusion - Getting Started, Design and Development.
-
Jolayne #1
Formatting cfmail: cfifs with no data causing large gap & commas
[url]http://www.desertadfed.com/membershipApp.cfm[/url]
[url]http://www.desertadfed.com/membershipAppResponse.cfm[/url] (handler)
Hi, Folks. Can someone help me with these two formatting issues?
On the above application form, I can't figure out how to fix two things:
1) See CFMAIL code below. Because data is not present, my cfif is causing a
huge white gap within the cfmail email.
2) See CFMAIL code below. Same basic thing results in no space after comma.
You indicated interest in the following committee(s): Membership,Programs
Thanks very much for your help!
Jolayne
1) Code:
<cfif Len(Trim(FORM.companyFirstFirstName)) GT 0>Company 1st Name:
#Trim(FORM.companyFirstFirstName)# #Trim(FORM.companyFirstLastName)#</cfif>
<cfif Len(Trim(FORM.companyFirstTitle)) GT 0>Company 1st Title:
#Trim(FORM.companyFirstTitle)#</cfif>
<cfif Len(Trim(FORM.companyFirstEmail)) GT 0>Company 1st Email:
#Trim(FORM.companyFirstEmail)#</cfif>
<cfif Len(Trim(FORM.companySecondFirstName)) GT 0>Company 2nd Name:
#Trim(FORM.companySecondFirstName)#
#Trim(FORM.companySecondLastName)#</cfif>
<cfif Len(Trim(FORM.companySecondTitle)) GT 0>Company 2nd Title:
#Trim(FORM.companySecondTitle)#</cfif>
<cfif Len(Trim(FORM.companySecondEmail)) GT 0>Company 2nd Email:
#Trim(FORM.companySecondEmail)#</cfif>
<cfif Len(Trim(FORM.companyThirdFirstName)) GT 0>Company 3rd Name:
#Trim(FORM.companyThirdFirstName)# #Trim(FORM.companyThirdLastName)#</cfif>
<cfif Len(Trim(FORM.companyThirdTitle)) GT 0>Company 3rd Title:
#Trim(FORM.companyThirdTitle)#</cfif>
<cfif Len(Trim(FORM.companyThirdEmail)) GT 0>Company 3rd Email:
#Trim(FORM.companyThirdEmail)#</cfif>
<cfif Len(Trim(FORM.companyFourthFirstName)) GT 0>Company 4th Name:
#Trim(FORM.companyFourthFirstName)#
#Trim(FORM.companyFourthLastName)#</cfif>
<cfif Len(Trim(FORM.companyFourthTitle)) GT 0>Company 4th Title:
#Trim(FORM.companyFourthTitle)#</cfif>
<cfif Len(Trim(FORM.companyFourthEmail)) GT 0>Company 4th Email:
#Trim(FORM.companyFourthEmail)#</cfif>
<cfif Len(Trim(FORM.companyFifthFirstName)) GT 0>Company 5th Name:
#Trim(FORM.companyFifthFirstName)# #Trim(FORM.companyFifthLastName)#</cfif>
<cfif Len(Trim(FORM.companyFifthTitle)) GT 0>Company 5th Title:
#Trim(FORM.companyFifthTitle)#</cfif>
<cfif Len(Trim(FORM.companyFifthEmail)) GT 0>Company 5th Email:
#Trim(FORM.companyFifthEmail)#</cfif>
<cfif Len(Trim(FORM.corporateOneFirstName)) GT 0>Corporate One Name:
#Trim(FORM.corporateOneFirstName)# #Trim(FORM.corporateOneLastName)#</cfif>
<cfif Len(Trim(FORM.corporateOneTitle)) GT 0>Corporate One Title:
#Trim(FORM.corporateOneTitle)#</cfif>
<cfif Len(Trim(FORM.corporateOneEmail)) GT 0>Corporate One Email:
#Trim(FORM.corporateOneEmail)#</cfif>
<cfif Len(Trim(FORM.corporateTwoFirstName)) GT 0>Corporate Two Name:
#Trim(FORM.corporateTwoFirstName)# #Trim(FORM.corporateTwoLastName)#</cfif>
<cfif Len(Trim(FORM.corporateTwoTitle)) GT 0>Corporate Two Title:
#Trim(FORM.corporateTwoTitle)#</cfif>
<cfif Len(Trim(FORM.corporateTwoEmail)) GT 0>Corporate Two Email:
#Trim(FORM.corporateTwoEmail)#</cfif>
<cfif Len(Trim(FORM.corporateThreeFirstName)) GT 0>Corporate Three Name:
#Trim(FORM.corporateThreeFirstName)#
#Trim(FORM.corporateThreeLastName)#</cfif>
<cfif Len(Trim(FORM.corporateThreeTitle)) GT 0>Corporate Three Title:
#Trim(FORM.corporateThreeTitle)#</cfif>
<cfif Len(Trim(FORM.corporateThreeEmail)) GT 0>Corporate Three Email:
#Trim(FORM.corporateThreeEmail)#</cfif>
<cfif Len(Trim(FORM.corporateFourFirstName)) GT 0>Corporate Four Name:
#Trim(FORM.corporateFourFirstName)#
#Trim(FORM.corporateFourLastName)#</cfif>
<cfif Len(Trim(FORM.corporateFourTitle)) GT 0>Corporate Four Title:
#Trim(FORM.corporateFourTitle)#</cfif>
<cfif Len(Trim(FORM.corporateFourEmail)) GT 0>Corporate Four Email:
#Trim(FORM.corporateFourEmail)#</cfif>
<cfif Len(Trim(FORM.corporateFiveFirstName)) GT 0>Corporate Five Name:
#Trim(FORM.corporateFiveFirstName)#
#Trim(FORM.corporateFiveLastName)#</cfif>
<cfif Len(Trim(FORM.corporateFiveTitle)) GT 0>Corporate Five Title:
#Trim(FORM.corporateFiveTitle)#</cfif>
<cfif Len(Trim(FORM.corporateFiveEmail)) GT 0>Corporate Five Email:
#Trim(FORM.corporateFiveEmail)#</cfif>
<cfif Len(Trim(FORM.corporateSixFirstName)) GT 0>Corporate Six Name:
#Trim(FORM.corporateSixFirstName)# #Trim(FORM.corporateSixLastName)#</cfif>
<cfif Len(Trim(FORM.corporateSixTitle)) GT 0>Corporate Six Title:
#Trim(FORM.corporateSixTitle)#</cfif>
<cfif Len(Trim(FORM.corporateSixEmail)) GT 0>Corporate Six Email:
#Trim(FORM.corporateSixEmail)#</cfif>
FINAL MEMBERSHIP SELECTION(S)
<cfif Len(Trim(FORM.a)) GT 0>Active Membership quantity:
#Trim(FORM.a)#</cfif>
<cfif Len(Trim(FORM.b)) GT 0>Associate Membership quantity:
#Trim(FORM.b)#</cfif>
<cfif Len(Trim(FORM.c)) GT 0>Non-resident Membership quantity:
#Trim(FORM.c)#</cfif>
<cfif Len(Trim(FORM.d)) GT 0>Company 1st Membership quantity:
#Trim(FORM.d)#</cfif>
<cfif Len(Trim(FORM.e)) GT 0>Company 2nd Membership quantity:
#Trim(FORM.e)#</cfif>
<cfif Len(Trim(FORM.f)) GT 0>Company 3rd-5th Membership quantity:
#Trim(FORM.f)#</cfif>
<cfif Len(Trim(FORM.g)) GT 0>Corporate Membership quantity:
#Trim(FORM.g)#</cfif>
<cfif Len(Trim(FORM.h)) GT 0>New Member Initiation Fee quantity:
#Trim(FORM.h)#</cfif>
TOTAL: #DollarFormat(totalPrice)#
2) spaces issue code: <cfif Len(Trim(FORM.committeeName)) GT 0>You indicated
interest in the following committee(s): #Trim(FORM.committeeName)#
<cfelse>No interest in committees at this time.</cfif>
Jolayne Guest
-
Send data from a form through email without using CFMAIL
Newbie question: I have this form that collects data from input boxes and would like to send that data to an email address. Is there a way to do... -
Formatting text output in cfmail
I have a form that our users can fill out to send an email. The message body is a textarea. The textarea value is passed through a formatting... -
CFMAIL and formatting question
I am using CFMX 7 and CFMAIL to send a 'newsletter' to a bunch of customers. I have all my CSS in the CFML code itself instead of attaching the... -
formatting the data in a datagrid
Hello, I wish to format the data in one of the columns of a datagrid so that it does not display more than 3 decimal places. I have a datagrid... -
Printing Commas in Large Number
I have some very large numnbers EX. 1234567890. I'd like to print the number with commas. EX: 1,234,567,890. I didn't see anything builtin in printf... -
James74 #2
Re: Formatting cfmail: cfifs with no data causing largegap & commas
What I've done is create a variable prior to the cfmail tag that is based on
all the cfif statements. Then, simply display the variable in cmail
James74 Guest
-
Jolayne #3
Re: Formatting cfmail: cfifs with no data causing large gap & commas
Hi, James. I'm afraid I'm not quite clear on what you are saying, but I will
try to figure it out.
Thank you for your response; I appreciate your time!
Jolayne
"James74" <webforumsuser@macromedia.com> wrote in message
news:d4gcnn$cm7$1@forums.macromedia.com...on> What I've done is create a variable prior to the cfmail tag that is based> all the cfif statements. Then, simply display the variable in cmail
Jolayne Guest
-
Jolayne #4
Re: Formatting cfmail: cfifs with no data causing large gap & commas
Yo, James:
Found this cool thing at easyCFM called "<cfsilient>". All I did was
surround the cfif's with that, and it made the white space go away!
Thanks again!
Jolayne
"Jolayne" <joheinen@NOSPAMheinline.com> wrote in message
news:d4h0qf$6nn$1@forums.macromedia.com...will> Hi, James. I'm afraid I'm not quite clear on what you are saying, but Ibased> try to figure it out.
> Thank you for your response; I appreciate your time!
> Jolayne
> "James74" <webforumsuser@macromedia.com> wrote in message
> news:d4gcnn$cm7$1@forums.macromedia.com...> > What I've done is create a variable prior to the cfmail tag that is> on>> > all the cfif statements. Then, simply display the variable in cmail
>
Jolayne Guest
-
Jolayne #5
Re: Formatting cfmail: cfifs with no data causing large gap & commas
I take that back. The cfsilent actually removes if the data is there
(greater than 0). Back to the drawing board!
"Jolayne" <joheinen@NOSPAMheinline.com> wrote in message
news:d4h52k$bb5$1@forums.macromedia.com...> Yo, James:
> Found this cool thing at easyCFM called "<cfsilient>". All I did was
> surround the cfif's with that, and it made the white space go away!
> Thanks again!
> Jolayne
> "Jolayne" <joheinen@NOSPAMheinline.com> wrote in message
> news:d4h0qf$6nn$1@forums.macromedia.com...> will> > Hi, James. I'm afraid I'm not quite clear on what you are saying, but I> based> > try to figure it out.
> > Thank you for your response; I appreciate your time!
> > Jolayne
> > "James74" <webforumsuser@macromedia.com> wrote in message
> > news:d4gcnn$cm7$1@forums.macromedia.com...> > > What I've done is create a variable prior to the cfmail tag that is>> > on> >> > > all the cfif statements. Then, simply display the variable in cmail
> >
>
Jolayne Guest
-
Stressed_Simon #6
Re: Formatting cfmail: cfifs with no data causing largegap & commas
What James74 was tryign to explain to you was the idea of doing all the cfif
work before the cfmail and using that to populate a variable with all your text
and then just output that in the mail.
It seems to me if you are getting loads of whitespace that you are sending a
non-HTML email, try setting the type = "HTML" in your cfmail tag. It may help!
Stressed_Simon Guest
-
James74 #7
Re: Formatting cfmail: cfifs with no data causing largegap & commas
Hi Jolayne
Here's an example:
Lets say name is required, but email is not:
Prior to the cfmail tag, create a variable that will hold your text. Let's
say you want
to use a table to format your message:
<cfset mailmsg = '<table>'>
<cfset mailmsg = variables.mailmsg & '<tr><td>
Name:</td><td>#form.firstname#</td></tr>'>
<cfif len(form.email)>
<cfset mailmsg = variables.mailmsg &
'<tr><td>Email:</td><td>#form.email#</td></tr>'>
</cfif>
<!--- Once you have covered all your variables, end the table --->
<cfset mailmsg = variables.mailmsg & '</table>'>
<cfmail>
#variables.mailmsg#
</cfmail
James74 Guest
-
Jolayne #8
Re: Formatting cfmail: cfifs with no data causing large gap & commas
Simon:
So sorry you are stressed. :)
Thank you so much for your very clear explanation. It's not quite done, but
I will let you know after I test it.
Appreciate your taking the time to reply, Simon.
Jolayne
"Stressed_Simon" <webforumsuser@macromedia.com> wrote in message
news:d4icd1$rsc$1@forums.macromedia.com...cfif> What James74 was tryign to explain to you was the idea of doing all thetext> work before the cfmail and using that to populate a variable with all yoursending a> and then just output that in the mail.
>
> It seems to me if you are getting loads of whitespace that you arehelp!> non-HTML email, try setting the type = "HTML" in your cfmail tag. It may>
Jolayne Guest
-
Jolayne #9
Re: Formatting cfmail: cfifs with no data causing large gap & commas
James:
Thank you very much for your example. I really appreciate it. Am running a
test, and I will let you know that it works, but I am sure it will from you
very clear sample. :)
Jolayne
"James74" <webforumsuser@macromedia.com> wrote in message
news:d4j024$pq0$1@forums.macromedia.com...Let's> Hi Jolayne
>
> Here's an example:
>
> Lets say name is required, but email is not:
>
> Prior to the cfmail tag, create a variable that will hold your text.> say you want
> to use a table to format your message:
>
> <cfset mailmsg = '<table>'>
> <cfset mailmsg = variables.mailmsg & '<tr><td>
> Name:</td><td>#form.firstname#</td></tr>'>
> <cfif len(form.email)>
> <cfset mailmsg = variables.mailmsg &
> '<tr><td>Email:</td><td>#form.email#</td></tr>'>
> </cfif>
> <!--- Once you have covered all your variables, end the table --->
> <cfset mailmsg = variables.mailmsg & '</table>'>
>
> <cfmail>
> #variables.mailmsg#
> </cfmail
>
>
>
Jolayne Guest
-
Jolayne #10
Re: Formatting cfmail: cfifs with no data causing large gap & commas
Hi, Simon and James.
Very, very intesting. The variables thing worked great, but I didn't use a
table, so I guessed at <p> and <br> tags, and just need some cleanup.
The email to me took forever, though, though, any reason for that?
Thanks so much, I am getting close!
Jolayne
"Jolayne" <joheinen@NOSPAMheinline.com> wrote in message
news:d4petj$h0u$1@forums.macromedia.com...but> Simon:
> So sorry you are stressed. :)
> Thank you so much for your very clear explanation. It's not quite done,your> I will let you know after I test it.
> Appreciate your taking the time to reply, Simon.
> Jolayne
> "Stressed_Simon" <webforumsuser@macromedia.com> wrote in message
> news:d4icd1$rsc$1@forums.macromedia.com...> cfif> > What James74 was tryign to explain to you was the idea of doing all the> > work before the cfmail and using that to populate a variable with all> text> sending a> > and then just output that in the mail.
> >
> > It seems to me if you are getting loads of whitespace that you are> help!> > non-HTML email, try setting the type = "HTML" in your cfmail tag. It may>> >
>
Jolayne Guest



Reply With Quote

