|
Firefox helpfully caching forms and their values |
||||||||
Whilst building a form recently I hit a real noob stumbling block. I was trying to set a select value to selected if the value had previously been submitted, something like this:
2 <select name="title" size="1" class="form-select">
3 <option value="">Please select from</option>
4 <cfloop list="#variables.prefix#" index="variables.index" delimiters=",">
5 <option value="#variables.index#" <cfif attributes.title EQ #variables.index#> selected="yes" </cfif>>#variables.index#</option>
6 </cfloop>
7 </select>
Pretty straight forward, you'll all agree. The issue comes in where I had entered selected="selected". This isn't the correct code for a select option.
Handily Firefox will cache the form structure and form data, so that when you refresh the page it just loads up the cached version. This is great if you coded it correctly, otherwise it happily serves you up your coding errors again. So don't refresh your forms in testing.
Add ?test=1 or something to make the request a new URL.
|
Recommended Applications - Belarc PC Audit software - Acronis True Image Home 2010 |
||||||||
Every now and then my PC gets a little clunky. Windows will gets a little slower once an installation of it is a bit long in the tooth. One really handy application that a friend recommended to me was Belarc's Personal PC Audit software.
It will create a log of all the applications and serial numbers on your system, which is great if you keep re-installing your operating system (I'm always forgetting which applications I'm running).
Along the same theme Acronis have just released the newest version of their backup software. True Image Home 2010 is Windows 7 compatible, and gives you a wealth of backup options, from full disk images to specific files. What most interests me though is the 'Continuous data protection' option. I've been used to team members working on Macs using 'Time machine' online continuous backup software, and this appears to have very similar functionality.

|
Exploring the variations in email UN subscription methods |
||||||||
If you are anything like me, everyday you are smothered in a stack of emails from various companies all delivering html formatted, image heavy flyers persuading you to buy whatever dead horse they are flogging. I know it is my own fault, after all I signed up to them in the first place, I've only got myself to blame. As I find myself checking (and deleting) these email on an Android mobile device now it has become hassle-some. So I set out to unsubscribe from the majority of them, which is where the inspiration for this article came from.
In a short period of time I have unsubscribed from around a dozen different email newsletters, and because of this the differences in the methods used to accomplish this have become glaringly obvious. I was very surprised at the variations in the methods used, some are very user friendly, and others are very much not. I won't name the companies involved.
Case one:
By far the easiest user interaction, this is a simple link from an email that provides you with a screen confirming your UN subscription. No prompt is required from the user, you are simply unsubscribed. All the data is passed seamlessly behind the scenes.
Case two:
Almost the same as above except that you are taken to a screen where you have to commit an action. You are presented with a screen displaying your email address, and prompted to click a button to confirm the UN subscribe action. This may be a handy safety net to step errors from the casual clicker.
Case three:
Clicking on the link from an email takes you to a generic page with a form on it. They have not transferred any form of token from the email so you are prompted to enter the email address you want to UN subscribe. Entering your email address takes you to a screen confirming your action. This additional step is unnecessary, and doesn't add any value at all.
Case four:
In this scenario we are passed to a page where we have to login. The subscription details are attached to an account application, and as such your credentials need to be verified. Based on passing an encrypted token from the email a user could easily be logged in automatically. Actually requiring a username and password adds an additional level of complexity. Once I logged in I then had to navigate to the subscription settings and choose to unsubscribe with a form similar to the ones mentioned above.
Case five:
In the most convoluted example I have come across so far I actually had to create an account. I arrived at the UN subscribe page and found that to subscribe did not require an account, but to change my subscription options did! This was a very strange scenario, requiring a user to create an account to stop emails. Once you have created an account the subscription options were managed through a form like the ones mention above.
Conclusions
I think the thing to keep in mind with functionality like this is the balance between usability and the business objectives. An obvious point to note is that businesses do not want their users to UN subscribe to their emails. This is their user base and they do not want to lose it. Still it is worth considering just how you interact with your customers, even when providing functionality you do not want them to use.
After all you can always just 'Mark as Spam'.
|
Image expired error message using CFChart |
||||||||
A bug came up in an application that uses the CFchart tag to create flash charts.
On the initial load the charts display just fine, but if you refresh the page, or go back to it later to view the data the images error. They display like this:

There seem to be two potential reasons for this. The first is that the cache for the chart in ColdFusion has expired. It seems that by default the per request cache is for 5 seconds only, so if your template takes longer than this to run then you may end out with expired content before you serve it up.
To fix this try this, excerpt from the CFchart blog:
1. Stop the CF server.
2. Open
2<server image="PNG" cache="Memory" minTimeout="5000" maxTimeout="30000"....
Change this to whatever values you want.(Values of minTimeout and maxTimeout are in milliseconds.)
Full article here: http://cfchart.blogspot.com/2005/06/image-expired-trouble.html
The second potential reason for this, and the more likely in this case is that the code is running on a clustered server. The error is cause where the CFchart tag generates a temporary file (swf, png, jpg) and serves that up to the user. When the user makes another request there is no guarantee that the request will hit the same server, so it will not find the temporary file, and throws the 'content expired' error message.
You could ensure that the content is served up correctly by tying the user to the server using session management, or more ideally set the temporary file to be written to a central server in a kind of CDN (Content Distributed Network) way.
I'm off to try both and see which one works!








