Lisa, The code snippet you posted is incorrect. You might need to post everything, but before you go that far the cfif/cfelse works like this.
<cfif condition> Condition true <cfelse> Condition false <cfelseif new condition> New true condition <cfelseif another new condition> Another New true condition </cfif But if it was me.. <cfswitch expression="#url.cat_id#"> <cfcase value="103"> Is 103 </cfcase> <cfcase value="100,106"> Is 100 or 106</cfcase> <defaultcase> Default </cfdefaultcase> </cfswitch> Regards, Andrew Scott Quote of the Day: Dictators ride to and fro upon tigers which they dare not dismount. And the tigers are getting hungry. - Winston Churchill -----Original Message----- From: Lisa Deemy [mailto:[EMAIL PROTECTED] Sent: Sunday, 16 October 2005 1:15 PM To: CF-Newbie Subject: RE: cfelse or cfelseif or neither Thank you, However if I don't use 2 </CFIFF> at the end of each I get error: Error: Context validation error for tag CFIF. The start tag must have a matching end tag. An explicit end tag can be provided by adding </CFIF>. If the body of the tag is empty you can use the shortcut <CFIF .../>. The error occurred on line -1. Thanks again, Lisa At 12:53 PM 10/16/05 +1000, you wrote: >Actually you are trying to close the cfif whith 2 close tags it should be > ><CFSET mode = "directory"> ><CFIF IsDefined("url.cat_id") IS True> > <CFIF #url.cat_id# IS "103"> ><CFELSE> ><CFSET mode = "category"> ></CFIF> > >And not > ><CFSET mode = "directory"> ><CFIF IsDefined("url.cat_id") IS True> > <CFIF #url.cat_id# IS "103"> ><CFELSE> ><CFSET mode = "category"> ></CFIF></CFIF> > >Also you can actually shorten your code to this > ><CFSET mode = "directory"> ><CFIF IsDefined("url.cat_id")> > <CFIF #url.cat_id# eq "103"> ><CFELSE> ><CFSET mode = "category"> ></CFIF> > > > >Regards, >Andrew Scott > >Quote of the Day: >Abe: Welcome home, son. I broke two lamps and lost all your mail. What's >wrong with your wife? Homer: Never mind, you wouldn't understand. Abe: >Flu? Homer: No. Abe: Protein deficiency? Homer: No. Abe: >Pneumonoultramicroscopicsilicovolcanoconiosis? Homer: No. Abe: >Unsatisfying sex life? Homer: N -- yes. But please, don't you say that >word! Abe: What, seeex? What's so unappealing about hearing your elderly >father talk about sex? I had seeeeex. >-----Original Message----- >From: Lisa Deemy [mailto:[EMAIL PROTECTED] >Sent: Sunday, 16 October 2005 11:53 AM >To: CF-Newbie >Subject: cfelse or cfelseif or neither > >Any help or input on this would be appreciated. > >I'm calling selected information from a database. There are several >categories and subcategories. >I want to call an entire category and list its subcategory contents for the >user. >I think the problem is in this part of the code as cfelse only appears 3 >times in the entire code. > >This (and other code) works to call all of category 103: > ><CFSET mode = "directory"> ><CFIF IsDefined("url.cat_id") IS True> > <CFIF #url.cat_id# IS "103"> ><CFELSE> ><CFSET mode = "category"> ></CFIF></CFIF> > >I added this (and other code) to collect the same type of information form >category 100: > ><CFSET mode = "directory"> ><CFIF IsDefined("url2.cat_id") IS True> > <CFIF #url2.cat_id# IS "100"> > <CFSET mode = "subcategory"> ><CFELSE> ><CFSET mode = "category"> ></CFIF> ></CFIF> > >The error I'm getting is: > >QueryString: >Error: Context validation error for tag CFELSE. The tag must be nested >inside a CFIF tag. >The error occurred on line -1. > >My questions are: 1. Do I need the syntax of using the 2 parts together >different that just using one? > >2. It appears I can't use <cfelseif > as it doesn't seem to like the < > >inside it's own < > tags. > ><CFIF Condition><CFELSEIF Condition><CFELSE></CFIF> > >Thanks, >Lisa > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:15:1442 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/15 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:15 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15 Donations & Support: http://www.houseoffusion.com/tiny.cfm/54
