============== ColdFusion TIPS PLUS ColdFusion 01 Volume 01 Issue 05 =============================================================== http://www.cftipsplus.com ============== Issue 00044 ============== I. Comments: II. ColdFusion Tip: Formatting CFMAIL By Scott Knaub SKnaub@benplan.com
III. ColdFusion Tip: Multiple Post Locations By Nathan Stanford admin@nsnd.com
============== I. Comments: Kevin Schmidt is sick so his article on Arrays will be in next weeks issue.
We have recieved plenty of good thoughts for our new e-zine, it will not replace the current e-zine.
We would like your response on how to make it well worth your time and money. So far plans are to allow you to get code and full applications.
=============================================================== If you have any suggestions please email me at cftips@nsnd.com. ===============================================================
=============================================================== II. ColdFusion Tip: Formatting CFMAIL: By Scott Knaub SKnaub@benplan.com
===============================================================
If you've ever sent a message with CFMAIL, you may have wondered why are there so many spaces to the left of each line in the message. To get the text in the mail message to display without a lot of spaces to the left, un-indent the CFMAIL tag in your code. CFMAIL sends the literal spaces it finds between its opening and closing tag. So if you are using good programming style and indenting the CFMAIL tag because it is contained within a CFIF, CFMAIL will e-mail the indented text as indented text. If you left justify your CFMAIL tag and the message it contains in your code, the mail message text will arrive without a lot of leading spaces on each line.
Example:
The following code is nicely formatted for readability - this is good programming style!
<CFIF Condition = True>
<CFMAIL TO="recipient@theworld.com" FROM="me@here.com" SUBJECT="Sample Mail">
Message text goes here
</CFMAIL>
</CFIF>
Unfortunately, the mail message will contain leading spaces like the sample below: -------------------------------- To: recipient@theworld.com From: me@here.com Subject: Sample Mail
Message text goes here --------------------------------
Now let's break the "good programming style" rules to clean up the mail message. The following code is formatted to remove the spaces from the mail message:
<CFIF Condition = True>
<CFMAIL TO="recipient@theworld.com" FROM="me@here.com" SUBJECT="Sample Mail">
Message text goes here
</CFMAIL>
</CFIF>
The mail message will not contain leading spaces...see the sample below: -------------------------------- To: recipient@theworld.com From: me@here.com Subject: Sample Mail
Message text goes here
--------------------------------
This type of message is what users are accustomed to seeing. So by simply removing some of the spacing in our code we can send a nicely formatted mail message.
============== III. JavaScript Tip: Multiple Post Locations By Nathan Stanford admin@nsnd.com ==============
If you want to have different buttons in the same form go to different pages when posted here is a way to do it.
<!--- You need to add the less then back in ---> script language="JavaScript"> function changeAction(myAction){ document.form1.action = myAction; document.form1.submit(); } /script> <!--- You need to add the less then back in ---> </head> <body> <form action="test1.cfm" name="form1"> <input type="submit" value="Back"> <input type="Button" value="Next" onclick="changeAction('test2.cfm')"> <input type="button" value="Save" onclick="changeAction('test3.cfm')"> </form>
============== Publisher and Creator: Nathan Stanford, admin@cftipsplus.com
Web Developers: Andres Adamoli, andres@adamoli.com Dain Anderson, danderson@cftipsplus.com Kevin Schmidt, schmidt@pwb.com Sarah Durham, sarah@rmls.com Scott Knaub, SKnaub@benplan.com Vincent Egt, vincent@e-dynamics.nl
============== Copyright (c) 2000 - 2001 CFTIPSPLUS.COM and NSND.COM Permission is granted to circulate this publication via MANUAL forwarding by email to friends provided that the text is forwarded in its entirety and no fee is charged. ==============
============== To unsubscribe: unsubscribe-cftips@nsnd.com
To subscribe: subscribe-cftips@nsnd.com ==============
____________________________________________________________ T O P I C A -- Learn More. Surf Less. Newsletters, Tips and Discussions on Topics You Choose. http://www.topica.com/partner/tag01