Solved

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

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
website file permissions 4 71
Coldfusion update database with CFLOOP 5 64
Has my website been infiltrated? 21 64
SSL sertificate 5 65
This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

815 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

11 Experts available now in Live!

Get 1:1 Help Now