You can do nested iif, but not a full cfif/cfelseif/cfelse

-----Original Message-----
From: Matthew Lowrey <[email protected]>
Sent: Tuesday, May 04, 2010 12:26 PM
To: cf-talk <[email protected]>
Subject: Re: <cfqueryparam> question ("null" attribute)


Sean, I'm pretty sure I already know this answer, but now that you've brought 
this new way of thinking to my attention.  I'm going to place my cards on the 
table here and ask the million dollar question.  Is it possible to have a 
cfelseif in this param? :-D  I know... I have a pair of 4's... not likely to 
beat your cards haha

Matt...

> YA!!!!!!!!!!!!!!!!!!!!!!!!  SEAN WINS THE PRIZE!! Thank you Mr. 
> Corfield.  This worked beautifully and better yet I didn't have to set 
> anything or cfif anything, just one tag with everything all inside of 
> it.  Thanks a million x yourVal
> 
> Matt...
> 
> > Since you're on CF9:
> > 
> > <cfqueryparam value="#isDefined('form.myVar')?form.myVar:''#"
> > null="#!isDefined('form.myVar')#" />
> > 
> > The (new in CF9) ?: operator only evaluates the true-expr if the
> > condition is true.
> > 
> > On Mon, May 3, 2010 at 8:12 AM, Matthew Lowrey <[email protected]> 
> > wrote:
> > > This is getting to be quite an interesting challenge.  All the 
> > examples I've seen logically make sense but none of them have worked 
> 
> > so far.  I will say I'm learning quite a bit from everyone's 
> > knowledge/wisdom.  I will try and list here all the different 
> methods 
> > I've tried out and have failed.  First, the method I've used (and 
> > still using):
> > >
> > > <cfif isDefined("form.myVal")><cfqueryparam 
> > cfsqltype="cf_sql_varchar" value="#form.myVal#" 
> > maxlength="50"><cfelse><cfqueryparam 
null="yes"></c



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:333329
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to