Matt Quackenbush wrote:
> It still generates an error because you're still using #form.fax# in the
> value attribute.
OK, now I'm confused.
> fax = <cfqueryparam
> value="#FORM.fax#"
> cfsqltype="CF_SQL_VARCHAR"
> null = "YesNoFormat(NOT (StructKeyExists(form,'fax'))" >
I'm understanding why the above generates an error:
value="#FORM.fax#" is evaluated first, so if it doesn't exist, an error
is thrown before it ever gets to the null statement.
But what if the order is switched?
fax = <cfqueryparam
null = "YesNoFormat(NOT (StructKeyExists(form,'fax'))"
value="#FORM.fax#"
cfsqltype="CF_SQL_VARCHAR" >
Seems like the null statement would now evaluate first and it would work.
But:
"The value of the attribute NULL is invalid. The value cannot be
converted to a boolean because it is not a simple value.Simple values
are booleans, numbers, strings, and date-time values."
I seem to be getting further and further away from what at first seemed
like a simple solution. What am I missing? I'm trying to avoid:
<cfif IsDefined("form.fax") AND #xox# NEQ "">
<cfqueryparam value="#FORM.fax#" cfsqltype="CF_SQL_VARCHAR" >
<cfelse>
NULL
</cfif>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:256046
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4