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 00142 http://www.cftipsplus.com

I. My Comments

II. ColdFusion In Context: Breaking Frames Without Javascript
By R. Martin Ladner
martin.ladner@charter.net


I. Comments:

If you want to see more photo's of my new son Christopher then go to link below.

More Photos of My Family
http://www.milforddel.com/photos/index.cfm

By the way make sure you check out the last few photos on the last page. There are some baby rabbits that are living behind our garage. They are very cute.

I am taking my son to work on Thursday, April 22, 2004 for Bring your Daughters and Sons to work day. So soon I should have some pictures up of my middle son, Anthony.


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:

NathanS<at>nsnd.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: Breaking Frames Without Javascript
By R. Martin Ladner
martin.ladner@charter.net


Suppose you want to send users home whose sessions have timed out or who have strayed into areas of the application in which they don't belong. Users who have talking browsers often have turned off javascript; so, you need a method that doesn't rely on javascript. If parts of your application use frames but your home page doesn't, here's an approach that will work.

Alternatives That Don't Work
The literature leads you to believe that you can send a header containing "window-target: _top" and have it honored by Netscape browsers. However, this doesn't work reliably and would only be browser-specific anyway. Base target="_top" doesn't work either for this purpose. It affects only subsequent controls (links and forms) on this page.
Other tools you might expect to solve the problem don't. ColdFusion's cflocation tag doesn't have a target attribute. The cfinclude tag adds code to the current page which is already locked inside a frame. Aiming cflocation at the parent of a different frameset puts the new frame inside the current frame. Meta refresh doesn't have a target attribute.

Links and forms do have target attributes and can pop frames, but you can't automatically submit them without javascript.

Most of the hands-off navigation of frames is therefore made possible by javascript. Javascript is used to pop the frame at the client. Javascript can be used to automatically change the location as it does this. Javascript can also be used to automatically submit a form that specifies a target.

Alternatives That Do
Without javascript, you're left with links and forms, both of which require explicit action from the user. However, that isn't so bad. You generally want the user to know what's going on when you drop the user out of an application. When javascript is available, you usually use a javascript alert followed by a javascript redirect. If you're going to do that anyway, then a statement followed by a link or a form submit button is a reasonable method of achieving this result.
See a Form Work
I vote for the form. To see it work, set the stage as follows. Imagine that a frame discovers that the user does not have the right role for a given task. Put this code in left.cfm.

<cfparam name="url.Role" default="">
<cfif url.Role is not "Friend">
<form target="_top" action="home.cfm" method="post">
You have strayed and must go home.
<input type="submit" value="OK">
</form>
<cfabort>
</cfif>

My Menu

Here's the right frame; put it in right.cfm.


My Display

Here's the frameset; put it in main.cfm, and give it a way to pass a value to left.cfm. As with all framesets, be sure to put the frameset after the head and before the body of the page.


<head>
</head>
<cfparam name="url.Role" default="">
<frameset cols="20%,*">
<frame src="left.cfm?Role=<cfoutput>#url.Role#</cfoutput>" name="Menu">
<frame src="right.cfm" name="Display">
</frameset>
<body>

Here's home; put it in home.cfm.


<a href="main.cfm">Go to Main and get bounced back</a>
<a href="main.cfm?Role=Friend">Go to Main and Stay</a>

Browse home.cfm and try both links. The first will give you a form telling you what's wrong and what will happen. The second shows you the application without interruption. =Marty=

=Marty=



Publisher and Creator:
Nathan Stanford,
NathanS<at>nsnd.com
http://www.cftipsplus.com

Macromedia and ColdFusion are U.S. registered trademarks.


Copyright (c) 2000 - 2004
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