Solved

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

Posted on 2002-03-29
3
150 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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

756 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