You have it is a string of quotes, it won't get processed as cfml inside quotes.
On 3/22/08, Mike Little <[EMAIL PROTECTED]> wrote:
> hey folk,
>
> in the following function, i have set a cfif in the option tag to allow for
> using same for for editing.
>
> however in the output, the cfif statement is output as text as opposed to
> being recognised as CF?
>
> <cffunction name="getRecursiveOptions" hint="Returns a string containing the
> option tags for an option list from a recursive query search"
> returntype="string" output="false" access="public">
> <!--- set the method arguments --->
> <cfargument name="parentID" hint="Provides the ID of the
> parent category to search in" required="yes" type="string" />
>
> <cfscript>
> var strOut = "";
> var qSubs = "";
> var option = "<option value=""[id]""<cfif
> this.parent_id EQ [id]> selected</cfif>>[dsp]</option>";
> var dsp = "";
> var i = 1;
> var depth = 0;
> qSubs = getSubs(arguments.parentID);
> if (qSubs.recordCount GT 0) {
> for (i=1; i LTE qSubs.recordCount; i=i+1) {
> depth =
> getDepth(qSubs[getProperty('parentField')][i]);
> strOut = strOut & option;
> strOut = replace(strOut, "[id]",
> qSubs[getProperty('parentField')][i], "All");
> dsp =
> repeatString(" ", depth-1) &
> qSubs[getProperty('dspField')][i];
> strOut = replace(strOut, "[dsp]", dsp);
> strOut = strOut &
> getRecursiveOptions(qSubs[getProperty('parentField')][i]);
> }
> }
> return strOut;
> </cfscript>
> </cffunction>
>
> can anyone see what i am doing wrong?
>
> mike
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301776
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4