Link to home
Start Free TrialLog in
Avatar of tauto
tauto

asked on

Returning multiple columns from dynamic drop list

I've created a form using Dreamweaver CS3 and Coldfusion MX6.  I have a dynamic drop down list that displays "Employee Name" but returns the vaule "Employee ID".  What is the easiest way to capture another column in the selected recordset e.g. "Employee Alternate Name"?
Avatar of tauto
tauto

ASKER

More info...I'm populating the drop down list by calling a stored procedure.  The stored procedure returns the following columns: EmployeeName, EmployeeID, AlternateName.  As stated previously, I'm using EmployeeName as the display name and EmployeeID as the value.  I need to capture the AlternateName value also.  Here's the code.  I'm passing EmployeeID and Alternatename as form variables.  EmployeeID is correct but Alternatename is always the first in the recordset.

<form id="form" name="form" method="post" action="test_output.cfm">
  <label>
  <span class="style1">Employee Name:</span>
  <select name="Employee" id="Employee">
    <option value="null"></option><cfoutput query="EmployeeRecordSet">
      <option value="#EmployeeRecordSet.EMPLOYID#">#EmployeeRecordSet.EMPLOYEE_NAME#</option>
    </cfoutput>
  </select>
  <input name="AlternateName" type="hidden" id="name" value="<cfoutput>#EmployeeRecordset.ALTERNATENAME#</cfoutput>" />
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of tauto

ASKER

I ended up passing "employeeid" to another page and running a sepearte query to return "alternataname".  Thanks for the help!