Solved

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

Posted on 2006-06-23
7
203 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
  • 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
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.

 

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 500 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Suggested Solutions

Title # Comments Views Activity
Spry missing in DWcc 6 320
Manipulate Access Database from Web Page 8 519
CF Buider 2 connect to remote server 6 81
Need graphics tool to create card game 2 148
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…

790 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