Solved

How to show a  OPTION values at  top in drop-down  list box form control?

Posted on 2002-03-29
3
144 Views
Last Modified: 2013-12-24
In the CFSELECT tag, First I am using a sybase query and then I use OPTION value. The OPTION value is always in botton in the drop-down list box. But my requirement is that OPTION value should be top of drop-down list box.

Could you some help me how to show up a Option value (The hardcoded one "ALL") at top?

Thanks in advance.

Pls have a look at the below code :


<CFQUERY NAME="SelAcct" DATASOURCE="#CSybDataSource#" USERNAME=#CSybUsername# PASSWORD=#CSybPassword#>
SELECT      distinct cUprFSACode
FROM     tblFSAAcctNameJa
ORDER BY cUprFSACode
</CFQUERY>

<CFQUERY NAME="SelDBFN" DATASOURCE="#CSybDataSource#" USERNAME=#CSybUsername# PASSWORD=#CSybPassword#>
SELECT      distinct cDBFN
FROM     tblDBFN
where cDBFN != ' '
order by cDBFN desc
</CFQUERY>

<HTML>
<HEAD>
     <TITLE>ABCD - Menu</TITLE>
     <SCRIPT LANGUAGE="JavaScript">

</SCRIPT>
</HEAD>

<BODY BGCOLOR="#DDDDFF" background="http://ap.dweb.it.db.com/images/topbar_back.gif">

<CFFORM NAME="form" ACTION="ABCDList.cfm" TARGET="main">
<TABLE BORDER="0">
          <TR>
               <TD> 
               <TD>
               <CFSELECT NAME="AcctList"
                        QUERY="SelAcct"
                        VALUE="cUprFSACode"
                        DISPLAY="cUprFSACode"
                        REQUIRED="yes"
                        SIZE="1">
                    <OPTION value="ALL">ALL
               </CFSELECT>
               </TD>
               <TD>
               <CFSELECT NAME="DBFNList"
                        QUERY="SelDBFN"
                        VALUE="cDBFN"
                        DISPLAY="cDBFN"
                        REQUIRED="yes"
                        SIZE="1">
               <OPTION value="ALL">ALL
               </CFSELECT>
               </TD>
               </TD>
               <TD>
                                <INPUT TYPE="submit" NAME="Go" Value="Go" ><font color="red"></font>
                                <INPUT TYPE="radio" NAME="ViewType" Value="Browser" CHECKED><font color="white">In Browser</font>
                    <INPUT TYPE="radio" NAME="ViewType" Value="Excel"><font color="white">Excel Download</font>
               </TD>
          </TR>
</TABLE>
</CFFORM>

</BODY>

</HTML>
0
Comment
Question by:cmurugavel
  • 3
3 Comments
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 6905016
Intead of

<CFSELECT NAME="AcctList"
                       QUERY="SelAcct"
                                              REQUIRED="yes"
                       SIZE="1">
                 
</CFSELECT>

Do this.(It should work...)

<cfoutput>
<CFSELECT name="droplist1" value="ALL">
<CFLOOP query="SelAcct">
   <OPTION VALUE="#cUprFSACode#" DISPLAY="#cUprFSACode#">
</cfloop>
</CFSELECT>
</cfoutput>

Hope this helps..

Sincerely,

Racimo



0
 
LVL 23

Expert Comment

by:Racim BOUDJAKDJI
ID: 6905030
Sorry Ignore my previous message replace

<CFSELECT NAME="AcctList"
   QUERY="SelAcct"
   VALUE="cUprFSACode"
   DISPLAY="cUprFSACode"
   REQUIRED="yes"
   SIZE="1">
   <OPTION value="ALL">ALL
</CFSELECT>
..BY....

<cfoutput>
<CFSELECT name="AcctList" value="ALL" value="ALL">
<CFLOOP query="SelAcct">
  <OPTION VALUE="#cUprFSACode#" DISPLAY="#cUprFSACode#">
</cfloop>
</CFSELECT>
</cfoutput>

AND...
<CFSELECT NAME="DBFNList"
   QUERY="SelDBFN"
   VALUE="cDBFN"
   DISPLAY="cDBFN"
   REQUIRED="yes"
  SIZE="1">
  <OPTION value="ALL">ALL
</CFSELECT>
BY..
<cfoutput>
<CFSELECT name="DBFNList" value="ALL" value="ALL">
<CFLOOP query="SelDBFN">
  <OPTION VALUE="#cUprFSACode#" DISPLAY="#cUprFSACode#">
</cfloop>
</CFSELECT>
</cfoutput>

This tiem it should be OK...
Sincerely,

Racimo

0
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 15 total points
ID: 6905037
More easily paste this...

<CFQUERY NAME="SelAcct" DATASOURCE="#CSybDataSource#" USERNAME=#CSybUsername# PASSWORD=#CSybPassword#>
SELECT      distinct cUprFSACode
FROM     tblFSAAcctNameJa
ORDER BY cUprFSACode
</CFQUERY>

<CFQUERY NAME="SelDBFN" DATASOURCE="#CSybDataSource#" USERNAME=#CSybUsername# PASSWORD=#CSybPassword#>
SELECT      distinct cDBFN
FROM     tblDBFN
where cDBFN != ' '
order by cDBFN desc
</CFQUERY>

<HTML>
<HEAD>
    <TITLE>ABCD - Menu</TITLE>
    <SCRIPT LANGUAGE="JavaScript">

</SCRIPT>
</HEAD>

<BODY BGCOLOR="#DDDDFF" background="http://ap.dweb.it.db.com/images/topbar_back.gif">

<CFFORM NAME="form" ACTION="ABCDList.cfm" TARGET="main">
<TABLE BORDER="0">
         <TR><TD>
             <CFOUTPUT>
              <TD>
              <CFSELECT name="AcctList" value="ALL"   DISPLAY="ALL">
<CFLOOP query="SelAcct">
 <OPTION VALUE="#cUprFSACode#" DISPLAY="#cUprFSACode#">
</cfloop>
</CFSELECT>
             </TD>
              <TD>
             <CFSELECT name="DBFNList" value="ALL"  display="ALL">
<CFLOOP query="SelDBFN">
 <OPTION VALUE="#cDBFN#" DISPLAY="#cDBFN#">
</cfloop>
</CFSELECT>
              </TD>
             </CFOUTPUT>
              </TD>
              <TD>
                               <INPUT TYPE="submit" NAME="Go" Value="Go" ><font color="red"></font>
                               <INPUT TYPE="radio" NAME="ViewType" Value="Browser" CHECKED><font color="white">In
Browser</font>
                   <INPUT TYPE="radio" NAME="ViewType" Value="Excel"><font color="white">Excel Download</font>
              </TD>
         </TR>
</TABLE>
</CFFORM>

</BODY>

</HTML>
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This video discusses moving either the default database or any database to a new volume.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now