?
Solved

Why is Dynamic drop down menu only pulling identifier and not label?

Posted on 2006-06-23
7
Medium Priority
?
208 Views
Last Modified: 2010-04-25
The Problem is that I have a TWO dropdowns in my DB table "Work_Detail" that pull from a different table "Workarea_ID".  Both "Workarea1" and "Workarea2" in my dropdown menu form pull from the same table IE:"Workarea_ID"  When I try to make it dynamic I can get the Identifier 1,2,3,4 from "Workarea_ID" to display but not the label I want IE: A,B,C,D.  How can I get the label to display.  And I also want to be able to change the A,B,C,D from the web page and have them update in the Database through an administrator.
Here is my code.  Can someone please help?


<cfparam name="PageNum_Recordset1" default="1">
<cfquery name="Recordset1" datasource="MyDB">
SELECT *
FROM Work_detail
</cfquery>

<cfset MaxRows_Recordset1=10>
<cfset StartRow_Recordset1=Min((PageNum_Recordset1-1)*MaxRows_Recordset1+1,Max(Recordset1.RecordCount,1))>
<cfset EndRow_Recordset1=Min(StartRow_Recordset1+MaxRows_Recordset1-1,Recordset1.RecordCount)>
<cfset TotalPages_Recordset1=Ceiling(Recordset1.RecordCount/MaxRows_Recordset1)>

<body>

<h1 align="center">LearnCF</h1>
  <table width="542" border="1">
    <tr>
      <td width="163">WorkArea1</td>
      <td width="163">WorkArea2</td>
      <td width="194">Employee Name </td>
    </tr>
    <cfoutput query="Recordset1" startRow="#StartRow_Recordset1#" maxRows="#MaxRows_Recordset1#">
      <tr>
        <td><form name="form1" method="post" action="">
          <select name="select">
            <option value="#Recordset1.ID#">#Recordset1.Workarea1#</option>
          </select>
        </form></td>
        <td><form name="form2" method="post" action="">
          <select name="select">
            <option value="#Recordset1.ID#">#Recordset1.Workarea2#</option>
          </select>
        </form></td>
        <td>#Recordset1.Employee_Name#</td>
      </tr>
    </cfoutput>

Should I NOT use a repeating region to display my records?  I feel like I am so close but I can't figure it out.

Thanks
Nordite
0
Comment
Question by:Nordite
[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
  • 4
  • 2
7 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16971088
Hi Nordite,

>> Should I NOT use a repeating region to display my records?  I feel like I am so close but I can't figure it out.

Not in this case.  A repeat region for the above code will produce as many forms as you have records in the recordset and I don't think that is what you are looking for.

Instead, create a normal form with the two drop downs and in the Properties Panel, click the dynamic icon (the little lightning bolt) to bind the pull-down to your recordset.  DW will write the appropriate code to populate the selects for you.
0
 

Author Comment

by:Nordite
ID: 16998310
That does not fully answer my question.  Any ideas on how to get it to pull the Text into the displaying webpage instead of the unique ID# of the original table?
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 16998366
Does the text you want exist in the table?
0
New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

 

Author Comment

by:Nordite
ID: 17002123
Yes,
It is in the "Workarea_ID" table.  It is very simple table
column1      
    1
    2
    3
    4
column2
    A
    B
    C
    D
But my Access database uses this table "Workarea_ID" two use in two columns because the information is identical.
in other words in my Access database I have
"Hanging area"    "SpaceSaverarea"     These would be the two columns in my Access database
           A                          B            "A" and "B" would represent dropdown menu A and B in Acess database.  Each of these dropdown menus pull from "workarea_ID" because you can select A,B,C,D for either column in Access because you can select either A,B,C, or, D for the Hanging area or A,B,C, or, D for the SpaceSaver area.  What is happening is CF is using the numeric identifier instead of the text in my webpage.  I want to use the text A,B,C,D as the identifier.  Hope you are following this.
Thanks
Nordite    
 
 
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 17246573
Nordite,

Sorry for the delay.  You sort of got lost in the shuffle.

To make a dynamic pull down box to use column2, just set it the Dynamic List/Menu options, the way I have done here:

http://www.jasonsinternet.net/dynamiclist.jpg

If the correct columns exist in the recordset, there is no reason why DW should be forcing you to use one column over another.

0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 1500 total points
ID: 17407838
Hi mrichmon,

Unless I totally misread the problem, the posted jpg shows Nordite how to set a dynamic drop down.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month12 days, 17 hours left to enroll

777 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