Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

CFSELECT change order

$
0
0

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>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>