1. No need for # inside the cfif. :)
2. You shouldn't need to trim it if you use a contains.
3. You set CPU to a single value of AMD. Therefore, cpu.description
doesn't exist anymore.
On Sun, Oct 17, 2010 at 2:03 PM, Rick Sanders c...@webenergy.ca wrote:
How can I do a cfif contains?
Error
Subject: Re: cfif contains
1. No need for # inside the cfif. :)
2. You shouldn't need to trim it if you use a contains.
3. You set CPU to a single value of AMD. Therefore, cpu.description
doesn't exist anymore.
On Sun, Oct 17, 2010 at 2:03 PM, Rick Sanders c...@webenergy.ca wrote:
How can I do
Thankls Aaron.
RO
-Original Message-
From: Aaron Neff w...@itisdesign.com
Sent: Tuesday, February 23, 2010 12:05am
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: CFIF within CFmail?
Hi Robert,
Just adding another option..
cfmail to=t...@domain.com from=f...@domain.com cc
Try this:
cfset arguments=StructNew()
cfset arguments.from=FORM.email
cfif form.intype=K-12
cfset arguments.cc=te...@test2.com
/cfif
cfmail attributeCollection=arguments
...
/cfmail
-Original Message-
From: Orlini, Robert [mailto:rorl...@hwwilson.com]
Sent: Monday, February 22,
first of all, your cfif syntax is incorrect... Here's what I'd do:
cfparam name=ccEmail default= /
cfif form.inttype eq K-12
cfset ccEmail = te...@test2.com /
/cfif
cfmail from=#FORM.email# to=t...@test.com cc=#ccEmail# Subject=New
Jersey
!--- EMAIL CONTENTS HERE ---
/cfmail
This is
that will not work ...
you should have your CFIF before the cfmail tag
cfif form.intype EQ K-12CFSET V_cc=te...@test2.com CFELSE CFSET
V_cc= /Cfif
CFMAIL from=#FORM.email# To=t...@test.com cc=#V_cc#Subject=New Jersey
From: Orlini, Robert
I usually do this Before the CfMail...
cfparam name=variable.CCEmail Default=
cfif form.intype EQ K-12
cfset variable.CCEmail = te...@test2.com
/cfif
CFMAIL
from=#FORM.email#
To=t...@test.com
cc=#variable.CCEmail#
Subject=New Jersey
Your Mail
/cfmail
Hope that Helps!
- Nick
cfif form.intype is K-12
cfset myCC = t...@test2.com
cfelse
cfset myCC =
/cfif
cfmail to=t...@test.com cc=#myCC# subject=New Jersey
/cfmail
Couple of things here.
1. Try not to use tags inside tags. It's hard to read.
2. You don't need pound signs (#) inside CF tags
Eww sexy
-Original Message-
From: Ben Forta [mailto:b...@forta.com]
Sent: Monday, February 22, 2010 10:02 AM
To: cf-talk
Subject: RE: CFIF within CFmail?
Try this:
cfset arguments=StructNew()
cfset arguments.from=FORM.email
cfif form.intype=K-12
cfset arguments.cc=te...@test2
/Cfif
Subject=New Jersey
-Original Message-
From: I. Addoum. [mailto:sol_xp...@yahoo.com]
Sent: Monday, February 22, 2010 9:03 AM
To: cf-talk
Subject: Re: CFIF within CFmail?
that will not work ...
you should have your CFIF before the cfmail tag
cfif form.intype EQ K-12CFSET V_cc=te
Phillips [mailto:experiencedcfdevelo...@gmail.com]
Sent: Monday, February 22, 2010 9:23 AM
To: 'cf-talk@houseoffusion.com'
Subject: RE: CFIF within CFmail?
Actually, that's not true. You can easily put CFIF inside of your cfmail
tag. I've done it for 12+ years! Your only problem was that you used
Should be:
cfif #form.intype# eq K-12cc=te...@test2.com/Cfif
On Mon, Feb 22, 2010 at 6:57 AM, Orlini, Robert rorl...@hwwilson.com wrote:
cfif #form.intype#=K-12cc=te...@test2.com/Cfif
It generates an error. Is there a better way to do this?
You can easily put CFIF inside of your cfmail tag.
You can have CF statements between the opening CFMAIL tag and the
closing /CFMAIL,
or inside an HTML tag, but never embedded inside another CF tag.
~|
Want to reach the
I'm trying to include a cfif within a cfmail. If a form element is K-12,
then I want to add a cc to the cfmail part.
Here is what I have in part:
CFMAIL from=#FORM.email#
To=t...@test.com
cfif #form.intype#=K-12cc=te...@test2.com/Cfif
Subject=New Jersey
It generates an error. Is there
Thank you all for the coding advice and code tidbits. It works now and I have a
better idea of what to do and not do with CFMail.
I know why I like this list!
RO
HWW
~|
Want to reach the ColdFusion community with something
Hi Robert,
Just adding another option..
cfmail to=t...@domain.com from=f...@domain.com cc=#((FORM.inputType is
'K-12') ? 'c...@domain.com' : '')# subject=subjectmessage/cfmail
Thanks!,
-Aaron
I'm trying to include a cfif within a cfmail. If a form element is
K-12, then I want to add a cc
You spelled elseif wrong
cfesleif mid(current_route_id,1,2) IS 02
should be
cfelseif
On Thu, Jul 23, 2009 at 10:55 AM, Michael Stevens bigm...@bigmikes.orgwrote:
Forgive me for what will be a really dumb question. I'm not real
experienced
with CF and it's been a long time since I've had
Wow... I knew it would be dumb but I think that's a record low for me...
Thanks!
-Original Message-
From: Alan Rother [mailto:alan.rot...@gmail.com]
Sent: Thursday, July 23, 2009 11:02 AM
To: cf-talk
Subject: Re: cfif, cfifelse problem... Invalid token 'apos;'...
You spelled elseif
Nah.. Thats not soo bad.. In fact I had to read it several times before I
saw it.
=]
--
Alan Rother
Adobe Certified Advanced ColdFusion MX 7 Developer
Manager, Phoenix Cold Fusion User Group, AZCFUG.org
~|
Want to reach the
think that's a record low for me...
Thanks!
-Original Message-
From: Alan Rother [mailto:alan.rot...@gmail.com]
Sent: Thursday, July 23, 2009 11:02 AM
To: cf-talk
Subject: Re: cfif, cfifelse problem... Invalid token 'apos;'...
You spelled elseif wrong
cfesleif mid(current_route_id
Just because I can't help myself, you may find the whole thing more readable,
and easier to maintain with a CFSWITCH statement in place of all those ELSE's.
Also probably more performant with only parsing the string once or twice per
loop.
cfoutput query=Recordset1
cfset route =
To: cf-talk
Subject: Re: cfif, cfifelse problem... Invalid token 'apos;'...
Michael - I spent a good 5 minutes looking at it trying to figure out if you
mixed up single and double quotes or something.
Sometimes... well, forest. trees. all that. :)
On Thu, Jul 23, 2009 at 11:26 AM, Michael
.
-Original Message-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Thursday, July 23, 2009 11:30 AM
To: cf-talk
Subject: Re: cfif, cfifelse problem... Invalid token 'apos;'...
Just because I can't help myself, you may find the whole thing more
readable, and easier to maintain with a CFSWITCH
-
From: Jason Fisher [mailto:ja...@wanax.com]
Sent: Thursday, July 23, 2009 11:30 AM
To: cf-talk
Subject: Re: cfif, cfifelse problem... Invalid token 'apos;'...
Just because I can't help myself, you may find the whole thing more
readable, and easier to maintain with a CFSWITCH statement
You can try something like this:
cfif listFind( 1,2, type )
a href= ... /a
/cfif
or, a more verbose way, but it can end up being much longer if you add
possibilities:
cfif type EQ 1 OR type EQ 2
a href= ... /a
/cfif
Francois Levesque
http://blog.critical-web.com/
On Mon, Jul 13, 2009 at
You can try something like this:
cfif listFind( 1,2, type )
a href= ... /a
/cfif
or, a more verbose way, but it can end up being much longer if you add
possibilities:
cfif type EQ 1 OR type EQ 2
a href= ... /a
/cfif
Francois Levesque
http://blog.critical-web.com/
So what if I already
Juste replace type by schoolTypeID
cfif listFind( 1,2, schoolTypeID )
a href= ... /a
/cfif
or, a more verbose way, but it can end up being much longer if you add
possibilities:
cfif schoolTypeID EQ 1 OR schoolTypeID EQ 2
a href= ... /a
/cfif
Francois Levesque
http://blog.critical-web.com/
Juste replace type by schoolTypeID
Francois Levesque
http://blog.critical-web.com/
Got it. Thanks so much for your help!
~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of
18301
570-422-3999
http://www.esu.edu
slaba...@po-box.esu.edu
-Original Message-
From: Peter Boughton [mailto:bought...@gmail.com]
Sent: Wednesday, June 03, 2009 5:30 PM
To: cf-talk
Subject: [Spam?] Re: CFIF Not Working As Expected
Why do you suggest using the StructKeyExists
Try this:
cfif StructKeyExists(Form,'Name') AND Len(trim(Form.Name))
cfoutputpYou have requested CMS access for /cfoutput
cfif StructKeyExists(Form,'RequestName') AND
Len(trim(Form.RequestName))
cfoutputstrong#Form.Name#/strong and
University
200 Prospect St.
East Stroudsburg, Pa 18301
570-422-3999
http://www.esu.edu
slaba...@po-box.esu.edu
-Original Message-
From: Peter Boughton [mailto:bought...@gmail.com]
Sent: Wednesday, June 03, 2009 2:00 PM
To: cf-talk
Subject: Re: CFIF Not Working As Expected
Try
Why do you suggest using the StructKeyExists?
Because it is the most efficient way to check if the Form scope contains the
Name field.
Do you see a problem in doing it this?
cfif form.name NEQ AND form.requestname NEQ
...
The main problem is that there is nothing to check/enforce that
Hi Bruce,
I don't see any issue with CFIF. I have used your code to test it and it
works find on IE and Firefox both. Check out the below code by executing
in browser.
Thanks Regards,
Jayesh Viradiya
Adobe CF Team
cfparam name=GetScheduleInfoRet.Shift default=
form name=frm
input type=text
HTML is an xml subset.
-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 22, 2007 10:53 AM
To: CF-Talk
Subject: Re: CFIF Pissing me off
is selected=selected so bad?
Bad, I don't know, but for the least, useless and stupid.
why
I do XHTML compliant code because I am finding more and more places are
making it part of their requirements when I do work on a project for them.
I just find it easier to do all the time than just selectively when it is
needed. It is not like it takes much, if any, more effort to do it over not
is selected=selected so bad?
Bad, I don't know, but for the least, useless and stupid.
why rile against a movement towards XML standards?
Because HTML is HTML, XML is XML.
If one needs to use XML, fine, but so far, all browsers are able to read
HTML,
so I don't see why I should bother make
is selected=selected so bad?
Bad, I don't know, but for the least, useless and stupid.
Useless if you don't want your HTML as XML granted, clearly essential if you
do. Stupid? Yes, the people who created XML are clearly below average IQ.
why rile against a movement towards XML standards?
with strict xhtml standards...selected does have a value of selected.
According to the standard, ever attribute has a value.
Eric
Original Message
Subject: Re: CFIF Pissing me off
From: Claude Schneegans [EMAIL PROTECTED]
Date: Tue, August 21, 2007 9:53 am
To: CF-Talk cf
HTML is an xml subset.
Absolutely not.
Both HTML and XML are norms compliant to SGML and, with an adequat DTD,
XML can be used to englobe HTML,
but HTML was introduced prior to XML, and so far, HTML is THE standard
for the web, XML is not.
And even so, why use a superset when a subset is
I am finding more and more places are
making it part of their requirements when I do work on a project for them.
Now, this is a good reason, even if customers don't even know why they
want id XHTML compliant ;-)
--
___
REUSE CODE! Use custom tags;
See
They know why(or at least why enough), the state is telling them it has to
be along with some other requirements. Well at least the clients in the
medical and education fields.
On 8/22/07, Claude Schneegans [EMAIL PROTECTED] wrote:
I am finding more and more places are
making it part of their
blah.
-Original Message-
From: Claude Schneegans [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 22, 2007 12:14 PM
To: CF-Talk
Subject: Re: CFIF Pissing me off
HTML is an xml subset.
Absolutely not.
Both HTML and XML are norms compliant to SGML and, with an adequat DTD,
XML
is selected=selected so bad?
Bad, I don't know, but for the least, useless and stupid.
It's neither useless nor stupid. Boolean attributes in HTML aren't
consistent with how HTML attributes are written - as name-value pairs.
Consistency has an obvious value.
If one needs to use XML, fine,
XHTML provides several advantages over HTML, such as a clearer separation
between formatting and content.
Add to that portability!
This argument reminds of a news article I read yesterday on a Jamaican who
proudly defied the evacuation of his town, due to the incoming hurricane,
with
I think it is selected=true, or you can just use option value=B
selected.
Not sure if that is your problem, but that's what jumped out at me.
Also, be careful when you test in FF, as it tends to cache your form
selections even upon a ctrl-refresh. That has gotten me quite a few times.
I usually
You might just use the word selected instead of selected=selected. In
both cases HTML finds the keyword selected so it takes the second one.
Nothing to do with CFIF... :-)
Greetings / Grüsse
Gert Franz
Customer Care
Railo Technologies GmbH
[EMAIL PROTECTED]
www.railo.ch
Join our Mailing List
Also, what does the page source look like? You can tell which block fired
by looking there, and determine if it is really a CF issue or just an html
issue.
On 8/21/07, Crow T. Robot [EMAIL PROTECTED] wrote:
I think it is selected=true, or you can just use option value=B
selected.
Not sure
The problem is not with CFIF but with your HTML.
The SELECTED attribute in a SELECT takes no value:
option value=B selected
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address:
BTW, Lots of code for just two options. Try this:
select name=Shift
cfloop list=Breakfast,Lunch,Dinner,Supper,Midnight Snack,Elevenses,Afternoon
Snack,Purge index=ii
option value=#left(ii,1)# cfif GetScheduleInfoRet.Shift eq
left(ii,1)selected=selected/cfif#ii#/option
/cfloop
/select
At
Bruce,
It seems a lot of work... I have always used the following for selecting
an option.
select name=Shift
option value=B cfif (GetScheduleInfoRet.Shift) IS
Bselected/cfifBreakfast/option
option value=L cfif (GetScheduleInfoRet.Shift) IS
Lselected/cfifLunch/option
/select
Thanks,
Dan
At 12:51 PM 8/21/2007, Crow T. Robot wrote:
Also, be careful when you test in FF, as it tends to cache your form
selections even upon a ctrl-refresh. That has gotten me quite a few times.
I usually test these things in IE just to be safe.
I noticed that too. I just click to another page and
That is exactly what was happening. Using FF to view the work and I forgot
that FF does this.
Bruce
-Original Message-
From: Mik Muller Sent: Tuesday, August 21, 2007 10:04 AM
To: CF-Talk
Subject: Re: CFIF Pissing me off
At 12:51 PM 8/21/2007, Crow T. Robot wrote:
Also, be careful when
On 8/21/07, Claude Schneegans [EMAIL PROTECTED] wrote:
The problem is not with CFIF but with your HTML.
The SELECTED attribute in a SELECT takes no value:
option value=B selected
it does in XHTML. selected=selected is valid XHTML. the shorthand
selected is not.
--
Charlie Griefer
Yeah, that is the problem with using DWCS3. It installs shit
like Selected=Selected.
Look at the top line of your HTML document. If it's an XHTML document, then
you're getting the right shit. If you choose another DOCTYPE, Dreamweaver
will generate valid HTML for that DOCTYPE as well.
When
, August 21, 2007 9:54 AM
To: CF-Talk
Subject: Re: CFIF Pissing me off
The problem is not with CFIF but with your HTML.
The SELECTED attribute in a SELECT takes no value:
option value=B selected
~|
ColdFusion 8 - Build next
The problem is not with CFIF but with your HTML.
The SELECTED attribute in a SELECT takes no value:
option value=B selected
It does with XHTML. Just like checkboxes have to be checked=checked :)
Paul
~|
Download the
Got-cha!. Thanks.
-Original Message-
From: Dave Watts [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 21, 2007 10:33 AM
To: CF-Talk
Subject: RE: CFIF Pissing me off
Yeah, that is the problem with using DWCS3. It installs shit
like Selected=Selected.
Look at the top line of your HTML
it does in XHTML. selected=selected is valid XHTML. the shorthand
selected is not.
One more reason I don't use XHTML ;-)
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.com/claude/customtags/tagstore.cfm
(Please send any spam to this address:
One more reason I don't use XHTML ;-)
I don't see why that is a reason... is selected=selected so bad? With so
much wrong with the HTML format, or more precisely with browsers reading it,
why rile against a movement towards XML standards?
I realise this is off the question - just reading all
XSL has xsl:if and xsl:choose tags that can be used for conditional logic.
cheers,
barneyb
On 6/6/07, Dave Francis [EMAIL PROTECTED] wrote:
I use xmlTransform to turn a taxonomy into a tree of html
checkboxes. For later editing, I need to set those checkboxes which were
previously
Take a look at the DateDiff function. You can use that to accomplish
your task.
-Original Message-
From: Elaine Mingus [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 24, 2007 12:03 PM
To: CF-Talk
Subject: CFIF and suppressing a register button if event_date is in
the past
I have an
cfif DateCompare(eventdate,Now(),d) is -1
suppress button
/cfif
-- Josh
- Original Message -
From: Elaine Mingus [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Thursday, May 24, 2007 9:03 AM
Subject: CFIF and suppressing a register button if event_date is in the
past
I
1) just curious... why not use cfif URL.showAll GTE 25 and omit the
cfelse rather than have an empty condition?
2) is URL.showAll a numeric value or a boolean? at one point you set
it as YES... but in your conditional you're evaluating whether or
not it's less than 25?
On 4/4/07, Steve LaBadie
04, 2007 3:55 PM
To: CF-Talk
Subject: Re: CFIF - Not to show
1) just curious... why not use cfif URL.showAll GTE 25 and omit the
cfelse rather than have an empty condition?
2) is URL.showAll a numeric value or a boolean? at one point you set
it as YES... but in your conditional you're evaluating
Matt Robertson wrote:
http://webapper.net/index.cfm?fuseaction=Fuseblog.ShowCommentsArticleID=20060727042244
I am cringing at all of the code I have running under switches under
the supposition that its more efficient code. Hell... thats what a
case statement is supposed to be in the
of a loop, the performance difference was virtually
undetectable.
HTH,
Rich Kroll
-Original Message-
From: Doug Brown [mailto:[EMAIL PROTECTED]
Sent: Monday, January 29, 2007 6:18 PM
To: CF-Talk
Subject: Re: cfif vs cfswitch
Still waiting to hear if this was involved with CFMX7. I
Does this cfswitch vs cfif performance difference apply to similarly
coded stuff within cfscript areas, considering the syntax is slightly
different? I'm assuming the same issues apply, but figured it was worth
asking.
--Scott
On 1/30/07, Jochem van Dieten [EMAIL PROTECTED] wrote:
Matt Robertson wrote:
Do you just take somebodies word for it or have you benchmarked it
yourself in your own environment?
One thing I lack is testing platforms, so the answer is the former,
with respect to the people saying it was faster
On 1/30/07, Richard Kroll [EMAIL PROTECTED] wrote:
We noticed that when the cfswitch was
outside of a loop, the performance difference was virtually
undetectable.
Good point. The performance difference on a single operation could
well be acceptable, if still suboptimal.
I agree with Jochem's suggestion of using cfswitch for numeric or perhaps
single character searches.
CF offers short circuit evaluation that increases the speed of boolean
decisions.
Whenever you need more than one cfif or cfelseif, you need to really
evaluate which condition is the most likely
I agree with Jochem's suggestion of using cfswitch for numeric or
perhaps
single character searches.
The problem as noted in the link Jochem provided is that when using
cfswitch, CF under the hood attempts a toDouble(), which if it is
numeric hums happily along. If you pass in any type of
On 1/29/07, Cutter (CFRelated) [EMAIL PROTECTED] wrote:
Recently I rewrote one of the templates within our massive system. The
template had two large cfif/cfelseif blocks that appeared better suited
for switch/case statements, which I implemented in cfscript. When my
boss saw this he said that
Cutter (CFRelated) wrote:
Recently I rewrote one of the templates within our massive system. The
template had two large cfif/cfelseif blocks that appeared better suited
for switch/case statements, which I implemented in cfscript. When my
boss saw this he said that there were issues with
New to me, too.
On 1/29/07, Cutter (CFRelated) [EMAIL PROTECTED] wrote:
Recently I rewrote one of the templates within our massive system. The
template had two large cfif/cfelseif blocks that appeared better suited
for switch/case statements, which I implemented in cfscript. When my
boss saw
Cutter (CFRelated) wrote:
Recently I rewrote one of the templates within our massive system. The
template had two large cfif/cfelseif blocks that appeared better suited
for switch/case statements, which I implemented in cfscript. When my
boss saw this he said that there were issues with
What issues could there be? It either works or it doesn't. It's not like
CFDocument or something where there are a whole bunch of moving parts
involved.
He could be questioning the speed, but if anything I would imagine a
cfswitch would be quicker than a bunch of cfif/cfelse statements,
just say yes to switch / case.
I'm not aware of any issues but I'd be happy to learn something new today.
--
[EMAIL PROTECTED]
Janitor, The Robertson Team
mysecretbase.com
~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2
As usual Jochem is the final word...very good to know that!
Hopefully this will be addressed in CF8.
- Original Message -
From: Josh Nathanson [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Monday, January 29, 2007 2:05 PM
Subject: Re: cfif vs cfswitch
What issues
On 1/29/07, Josh Nathanson [EMAIL PROTECTED] wrote:
As usual Jochem is the final word...very good to know that!
Holy cow. Indeed. Thanks Jochem.
I am cringing at all of the code I have running under switches under
the supposition that its more efficient code. Hell... thats what a
case
Subject: Re: cfif vs cfswitch
As usual Jochem is the final word...very good to know that!
Hopefully this will be addressed in CF8.
- Original Message -
From: Josh Nathanson [EMAIL PROTECTED]
To: CF-Talk cf-talk@houseoffusion.com
Sent: Monday, January 29, 2007 2:05 PM
Subject: Re
Ok, now I'd like to know how your boss knew this, and most of us didn't on the
list! lol!
Will
~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 MX7 integration create powerful cross-platform RIAs
Message-
From: RobG [mailto:[EMAIL PROTECTED]
Sent: Monday, 29 January 2007 15:57
To: CF-Talk
Subject: Re: cfif vs cfswitch
Cutter (CFRelated) wrote:
Recently I rewrote one of the templates within our massive system. The
template had two large cfif/cfelseif blocks that appeared better
suited
Something like this?
cfif len(asking1)
Insert asking 1
cfelseif(len(asking2))
Insert asking 2
cfelse
Insert default
/cfif
On 22/12/06, Doug Brown [EMAIL PROTECTED] wrote:
Arghhh.. as Captain Jack Sparrow would say. Anybody from the daytime
crew wanna shot at this? I cannot
Nope...asking1 will insert, but if asking2 is filled in instead, it will not
insert.
Doug B.
~|
Create robust enterprise, web RIAs.
Upgrade integrate Adobe Coldfusion MX7 with Flex 2
Ok. I finally figured it out. I did it off the value of the radio buttons
instead. Thanks for all the help, I think I just needed to sleep on it.
cfif #Trim(arguments.price_option)# eq negotiable
price = #arguments.asking1#,
/cfif
cfif #Trim(arguments.price_option)# eq fixed
How about this:
CFPARAM name=ARGUMENTS.asking1 DEFAULT=
CFPARAM name=ARGUMENTS.asking2 DEFAULT=
CFSET price = listFirst(#ARGUMENTS.asking1#,#ARGUMENTS.asking1#,0)
This way (and since CF ignores empty elements in lists), price will take
the first non empty value,
and 0 if both are empty.
--
On 12/21/06, Doug Brown [EMAIL PROTECTED] wrote:
I am having some troubles with an if statement and cannot seem to get it
right. I have 2 text fields that hold the value of the price of items a user
is selling, a user can fill in either one of the fields or none at all. If
the user chooses
Ignore the NULL bye the way !!!
Doug B.
~|
Create robust enterprise, web RIAs.
Upgrade integrate Adobe Coldfusion MX7 with Flex 2
if your searching for length or lack there of I prefer to use the len()
method along with trimming any trailing or preceeding whitespace
cfif len(trim(arguments.asking1)
/cfiif
On 12/21/06, John Cox [EMAIL PROTECTED] wrote:
On 12/21/06, Doug Brown [EMAIL PROTECTED] wrote:
I am having some
No, it is not the syntax that is the problem. What happens when the user
does not enter any information into one of the two fields, then I need to be
able to add a default value to the database. If a user enters an amount,
then I need to place that info in the database. I hope this makes sense.
oops
cfif len(trim(arguments.asking1))
/cfiif
On 12/21/06, Dan Vega [EMAIL PROTECTED] wrote:
if your searching for length or lack there of I prefer to use the len()
method along with trimming any trailing or preceeding whitespace
cfif len(trim(arguments.asking1)
/cfiif
On 12/21/06,
How 'bout
cfif len(arguments.asking1) or len(arguments.asking2)
cfif len(arguments.asking1)
price = #arguments.asking1#,
cfelse
price = #arguments.asking2#,
/cfif
cfelse
price = 0,
/cfif
- Original Message -
From: Doug Brown [EMAIL PROTECTED]
To: CF-Talk
You want to use the cfparam tag then to set default paramters.
cfparam name=form.asking1 default=
cfparam name=form.asking2 default=
!--- sql insert ---
Now when you do the insert it will either enter the default which in this
case is an empty string (it can be anything) or if form.asking1 or
cfif arguments.asking1 neq and arguments.asking2 eq
price = #ARGUMENTS.asking1#,
cfelseif arguments.asking1 eq and arguments.asking2 neq
price = #ARGUMENTS.asking2#,
cfelse
price = NULL,
/cfif
Andrew Scott
Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Nope, wont work. Still the same result as before, 2nd field will not insert
and default wont either.
Doug B.
~|
Create robust enterprise, web RIAs.
Upgrade integrate Adobe Coldfusion MX7 with Flex 2
Just to make this easy for everybody to understand. Here is what is happing,
bye the way this is an update to the database.
input type=radio value=Firminput type=text name=asking1 value=
User enters price (firm price)
OR
input type=radio value=Negotiableinput type=text name=asking2
value= User
try a trim() as well.
cfif len(trim(arguments.asking1)) GT 0 or len(trim(arguments.asking2)) GT 0
cfif len(trim(arguments.asking1)) GT 0 AND
len(trim(arguments.asking2)) EQ 0
... (etc)
also, just out of curiousity... your first 2 radio buttons aren't
named, so aren't passing
also, just out of curiousity... your first 2 radio buttons aren't
named, so aren't passing anything to the action page, are they? just
wondered what purpose they served.
Actually they do, I just shortened a little so it was more readable.
You might also just want to have one form field for
On 10/3/06, Dave Watts [EMAIL PROTECTED] wrote:
...
I don't think it matters that much one way or the other. I simply think we
should be more careful about how we define best practices generally.
Nothing /really/ matters. In the long run. ;-)
I would think that best practice depends on how
Aaron Rouse wrote:
He wants it when the ucDescription contains that value and is not just equal
to it or was that a typo in his CFIF? The case when then method may not
work depending on what DB he is using and the version of it.
Use a CASE statement in your SQL...
cfquery
1 - 100 of 532 matches
Mail list logo