ColdFusion Tips and Tutorials

ColdFusion Tips and Tutorials. Tips on ColdFusion, AJAX, CSS, JavaScript, HTML, Design, and more.

CFUnited Developer Conference 2010
Use this code TIPSCUST to get $100 off your registration @ CFUnited! We'll see you There!


ColdFusion Tips
Page 1 2 3
148 ColdFusion, Ajax, FuseBox, Tips, and Tut
147 Included Point of View
146 Javascript - OnFocus
145 Nathan's Rules of Professional Web Desig
144 Universal Server-Side Check | Bandwidth
143 Meeting Schedule | Identification Sessio
142 Breaking Frames Without Javascript
141 Unreal Forms
140 Screen Resolution
139 Human Help
138 Better Server-Side Validation
137 Automatic Server-Side Validation
136 Regular Expression Laboratory,ColdFusion
135 Rank-Ordered Site Search
134 Building Cryptograms
133 Well-Formed Includes
132 Grouping Families for Visits
131 Display Families on a Map Grid
130 Slide Shows
129 Determine Your Database Engine
128 ColdFusion in Context: Maxlength Lies
127 Something Extra
126 Parsing Database Structure from Data Def
125 Valid Values Maintenance
124 Print 1
123 Hide Session Id
122 Downsizing Data to Access
121 Time to Load a Page, FuseBox 4
120 Order and Rank by Subset
119 Warn through E-mail & Update on Paste Sp
118 Paste Spreadsheets, ColdFusion Component
117 Review Files Having Fixed-Length Fields
116 Organized Help
115 Sequence Slider
114 Bad Bits
113 Logical Deduction
112 Whiteout
111 Forced Navigation
110 Managing Permissions
109 Time Travel
108 Test First
107 Get Distance Between Map Coordinates
106 Validating Checkboxes
105 Matrix Manipulation
104 Field Help
103 Fake Object Not Found
102 Rank Order Correlation Coefficient
101 From Calling Pairs to Calling Tree
100 Posting Notice
99 Logout Persuasion
98 Release Session Memory
97 Use Identically Named Fields
96 Web Bug
95 Password Generation
94 Core Queries
93 Use CFFTP
92 Insert, Update, and Delete
91 Stack
90 T-Value
89 Bulk Data Entry and E-mail Validation
88 Quick Reset
87 Design 1
86 Use CFFTP
85 Support Login with AutoPost
84 Login and Site Protection
83 XY Graphs in a Graphing Calculator
82 Read Encrypted Files
81 Showing Progress
80 Frugal Cross-Browser Javascript
79 Tabbed Folders
Page 1 2 3



Custom Search
ColdFusion TIPS PLUS


Issue 00099 http://www.cftipsplus.com

I. My Comments

II. ColdFusion In Context: Logout Persuasion
By R. Martin Ladner
martin.ladner@knology.net



See our sponsors at the bottom of this e-mail.



I. Comments:

Job Looking:
If you were laid off and still have not found a job send me your contact email and city and state. Also tell me if you willing to move or not. No promises but I will see what I can do.

I will not send your information to the Employers. I will send you the Employers information.


Employee Looking:
If you have a ColdFusion Job and need someone to fill it please send in your requirements and I will forward the information to anyone who is looking for a job.



Keep Coding,
Nathan Stanford
http://www.cftipsplus.com

If you have suggestions for articles send them to us.
If you would like to write for cftipsplus.com
send us an email to:

admin@cftipsplus.com

IF YOU WANT TO BE AN AUTHOR SEND IN YOUR COLDFUSION TIPS.

Remember this is a great way to get your name known in the
ColdFusion Community.



II. ColdFusion in Context: Logout Persuasion
By R. Martin Ladner
martin.ladner@knology.net



Suppose you want the user to actually log out so you'll know it's OK to release variables in memory prior to their scheduled timeout. Users tend to simply close the window when they're done, and you won't know when they've done that.
One way to handle this problem is to create a parent window whose function is to open a child window for working and be available to nag the user into logging out if the user closes the work window directly.

Create the Context
Here is where the browser will go after logout; call it homepage.cfm.

Welcome to the login page.
<form>
<input type="button" name="doit"
value="Press to simulate log in"?
onClick="javascript:window.location='nag.cfm';">

</form>

Here is where you would add code to remove the session from memory; call it bye.cfm.


You've passed through a page (bye.cfm)<br>
that would remove your session variables from memory.<br>
<script language="javascript">
window.location = 'homepage.cfm';
</script>

Here is where the user will "work"; call it work.cfm. It gives the user a button that will shift the focus to the nag page that invites the user to log out.


Here's your work page. When you're tired of admiring it,<br>
click "Done" (or find nag.cfm).
<form>
<input type="button" name="leave" value="Done"
onClick="opener.window.focus();">

</form>

Do the Work
Pretending that login was successful and that the user has selected a work area, this code needs to open the work area, prime this page so it will check the focus the NEXT time the user touches it, and (if the user asks to log out) close the work area, call a page that would remove the session from the server if you were doing this for real, and deposit the user at the home page. Put all of the following code in nag.cfm.
First, prepare to open the work area. openchild1 names a new window "myChild1" when it creates it so we can use the name later to close it. Note that the features parameter that contains attributes such as toolbar and location (URL window) cannot have any spaces within it.


<head>
<script language="javascript">
function openchild1(mypage) {
myChild1 = window.open('work.cfm','myWindow',
'toolbar=yes,location=yes,scrollbars=yes,resizable=yes');
}

Next, prepare to close the window when asked.


function leave() {
if (!myChild1.closed) {
myChild1.close();
}
window.location = 'bye.cfm';
}

Finally, close the script tag and set the body to open the work window when the page has finished loading and to try to close it when the user logs out.


</script>
</head>
<body onLoad="openchild1('work.cfm');">
<form>
<input type="button" name="doit"
value="~~~ L O G O U T ~~~" onClick="javascript:leave()">

</body>

Try It Out
Browse homepage.cfm and press the button. The work page should appear. If you click "Done", nag.cfm will come forward, asking the user to log out. If you simply close work.cfm, nag.cfm will still be there as a reminder. If you go directly to nag.cfm and log out, it will close work.cfm if it isn't already closed. You wouldn't normally notice bye.cfm, but in this demonstration, it has visible text as a reminder that it's there.
Expand the concept and make it nicer, but be sure you can use your method for major versions of both major browsers. [grim grin] Then, please tell us what you've learned so we can build on higher ground.

=Marty=



SPONSOR ADS:
This e-mail is sponsored by the following ads.

Sponsored Ad


Advanced, Intensive ColdFusion Training!
Visit this site. If you have plans to get training here is a company
that provides Advanced, Intensive ColdFusion Training. Check them out.

http://www.coldfusiontraining.com/index.cfm?ref=cftipsplus




IT'S A WEB DEVELOPER'S DREAM COME TRUE

The book on Aestiva's web-based development engine
is here. Build web-based text editiors in ten lines
or less. Build shopping carts with a couple dozen
lines of code. Build database-driven apps in about
the time it takes you to do your laundry! Get the
book ADVANCED WEB SITES MADE EASY. For more info
please visit:

http://dev.aestiva.com/amazon/htmlostips.html


Sponsored Ad


Looking for other development resources?
Visit http://www.htmlostips.com, a site dedicated
to HTML/OS, a the next generation development
environment that many are saying is the next
generation to Java.

Sponsored Ad


Publisher and Creator:
Nathan Stanford,
admin@cftipsplus.com
http://www.cftipsplus.com

Macromedia and ColdFusion are U.S. registered trademarks.


Copyright (c) 2000 - 2002 C.F. Concepts, Inc.
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.

Photo of Nathan Stanford
Nathan Stanford
LinkedIn

R. Marty Ladner's
Site