Solved

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

Posted on 2002-03-29
3
154 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

717 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