Solved

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

Posted on 2006-06-23
7
201 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

24 Experts available now in Live!

Get 1:1 Help Now