[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-06-23
7
Medium Priority
?
212 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
6 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
[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

 

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

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

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…
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 lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

873 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