Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

CFSELECT change order

Engaged ,
Sep 09, 2013 Sep 09, 2013

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>

465
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation
Resources