I have a CFSELECT like following and I need sometime sort by MyCode and sometime sort by MyName
like following code
<cfif (isDefined("form.MyID") AND form.MyID EQ MySP.MyID)>selected="selected"</cfif>>#MySP.MyCode# - #MySP.MyName#</option>
or
<cfif (isDefined("form.MyID") AND form.MyID EQ MySP.MyID)>selected="selected"</cfif>>#MySP.MyName# - #MySP.MyName#</option>
I need switch MyName and MyCode and change sort order at run time.
Are there any place I can use CFIF to compare the condition to change?
Your help and information is great appreciated,
regards,
Iccsi,
<cfselect name="MyList" id="myList" >
<option value=""> </option>
<cfoutput query="MySP">
<option value="#MySP.MyID#"
<cfif (isDefined("form.MyID") AND form.MyID EQ MySP.MyID)>selected="selected"</cfif>>#MySP.MyCode# - #MySP.MyName#</option>
</cfoutput>
</cfselect>