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

I. My Comments

II. ColdFusion In Context: Maxlength Lies
By R. Martin Ladner
martin.ladner@charter.net



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

I. Comments:

Hope all is well with you. Still have not chosen a house to live it.

I wonder sometimes how many people out there are reading this. I know I
have a whole lot of you on my list. How many of you think this site and
this ezine is still useful.

Send me an email to cfnut<at>nsnd.com.
When you do tell me something about how this site has helped you? (If it
has)
Where you live? City, State, County, Country, etc.
Send me a photo of where you live. (If you want)
Make suggestions.
Ask Questions.
Or anything else you want.

Thanks!

By the way if your a company who wants to advertise here send me an
email as well but to NathanS<at>nsnd.com and we will see if it is
ColdFusion Related or not.



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: Maxlength Lies
By R. Martin Ladner
martin.ladner@charter.net


Suppose your application lets the user enter a vendor name manually or lets the user enter a short identifier such as a Commercial And Government Entity (CAGE) code to pull the vendor name from another application into your data entry form. Now suppose someone increases the size of the vendor name column in that external database.
What impact does this have on you? After all, you set a maxlength as part of the HTML entry field that you're going to populate from that external query. Can the length of the value in your entry field exceed the maxlength you've set?

It turns out that the HTML maxlength attribute only limits manual entry (including cut and paste). It doesn't limit what winds up being displayed in the field. If a very long string makes it into the field, you can scroll the entire string (and even remove characters) without maxlength having anything to say about it. The string does not get truncated to maxlength. Furthermore, the form variable that gets passed to your action page isn't limited by maxlength either.

Demonstration
This demonstration lets you see this unexpected behavior in operation. Put this code in max.cfm.

<form name="max" action="maxact.cfm" method="post">
Supposedly "Tiny" text; scroll it: <input type="text" name="Tiny"
value="The quick brown fox jumped over the lazy dog's back" size="15" maxlength="10">

<input type="submit" name="Go" value="Submit">
</form>

Put this code in maxact.cfm to display the form variable passed by the Web server.

<cfoutput>The value of Tiny is: #form.Tiny#</cfoutput>

Now browse max.cfm. You can scroll back and forth. Trying to change a character removes it, but the rest of the string remains intact. Submit the form. The entire (edited) string makes it to the next page.

Discussion
The action page for an entry form usually feeds a database. When you try to feed a string that's too long into your database, the customer will get a noisy database error telling you that you shouldn't do that. How do you avoid this kind of error? Check the length of data from someone else's data source before trying to consume it. If the string is too long, truncate it before posting and perhaps notify the developer (You!). It's unkind to send a noisy database error to a compliant customer who was merely unlucky enough to be the first to learn that an external data source you use for reference has changed. Be kind to your customer.

=Marty=



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


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


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

Macromedia and ColdFusion are U.S. registered trademarks.


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