Solved

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

Posted on 2006-06-23
7
200 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
Comment Utility
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
Comment Utility
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
Comment Utility
Does the text you want exist in the table?
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Nordite
Comment Utility
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
Comment Utility
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
Comment Utility
Hi mrichmon,

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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

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…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 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

8 Experts available now in Live!

Get 1:1 Help Now