I had an issue recently that you might remember, where a Mac-based user of a
CMS I've done was having problems using a form. Seems that IE on the Mac
likes adding whitespace or carriage returns to form fields, and those that I
set as boolean values were throwing errors when they're tested, because the
string "TRUE " doesn't evaluate as a boolean!
My catch-all solution was to include this code in Application.cfm:
<cfif IsDefined("form") AND IsStruct(form)>
<cfloop collection="#form#" item="field">
<cfset StructUpdate(form, field, Trim(StructFind(form, field)))>
</cfloop>
</cfif>
Does the trick, even if it's a little heavy-handed.
Now we've got another problem, in that you can't upload files. An error gets
thrown when you try, saying something like "form.filePath doesn't contain a
file".
Of course by the time you get to the server, form.filePath is something like
"C:\WinNT\Temp\AC0245.tmp" due to the way CF uploads stuff. But I really
can't see any difference between that field's value before or after the
Trim() code.
Does anyone know what's going on here?
My workaround for the meantime, as all my file upload fields are named
"filePath", is this:
<cfif IsDefined("form") AND IsStruct(form)>
<cfloop collection="#form#" item="field">
<cfif field NEQ "filePath">
<cfset StructUpdate(form, field, Trim(StructFind(form, field)))>
</cfif>
</cfloop>
</cfif>
But naturally I'm curious to know if there's a rational explanation behind
all this...
Gyrus
[EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://norlonto.net
PGP key available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4