Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populating data into a drop down box 1

Status
Not open for further replies.

scottew

IS-IT--Management
Mar 6, 2003
492
US
I have a form which I would to populate a drop down box with some data. Below is the query and part of the form. Currently, it puts each location in a separate drop down. How can I get all the data into one drop down box.

Any help will be greatly appreciated!

Thanks,
Scott



Code:
<cfquery name="getTerminal" datasource="mssqlcf_hibarsky" dbtype="odbc">
	select *
	from locations			
	</cfquery>

Code:
<tr>
 <td width="35%" align="right">Terminal Name:</td>	  
<td width="65%" align="left">
<cfoutput query="getTerminal">
<SELECT NAME="A)Terminal_Name" SIZE="1">
<OPTION VALUE="getTerminal">#getTerminal.name#</option>
			
</cfoutput>			
</SELECT>		    
 </td>
  </tr>
 
Move your cfoutput tags inside your select box and have them surround the option tags.
Code:
<tr>
 <td width="35%" align="right">Terminal Name:</td>      
<td width="65%" align="left">
<SELECT NAME="A)Terminal_Name" SIZE="1">
[red]<cfoutput query="getTerminal">[/red]
<OPTION VALUE="getTerminal">#getTerminal.name#</option>            
[red]</cfoutput>[/red]            
</SELECT>            
 </td>
  </tr>

Hope This Helps!

ECAR
ECAR Technologies

"My work is a game, a very serious game." - M.C. Escher
 
My next question is, once I select the Terminal from the drop down box, I would like to populate the remaining feilds in the form with a new single record query based on the terminal I selected.

Thanks again for your help!
Scott
 
Also check out FAQ232-6607 (this deals with 3 related select boxes but can be tweaked to only include 2 related select boxes)

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top