How to Make a Dynamic Pull-Down Menu in ColdFusion
The ColdFusion Web programming language provides you with the ability to dynamically create menus. The pull-down menu uses the HTML "combobox" class. A combobox is the drop-down selection box readers use to make a selection. ColdFusion supports dynamic Web creation, so you can create the combobox items using a database query or static values you place in the ColdFusion code.
Instructions
-
-
1
Open your Adobe ColdFusion software and the Web project you want to edit. Double-click the form that contains the drop-down box. If you do not have one created, you can drag and drop a combobox from the toolbox.
-
2
Create the connection and database query object that specifies the SQL that returns the list of combobox items from which the user can select. The following code gets the list of items:
<mx:RemoteObject id="con" showBusyCursor="true" destination="ColdFusion" source="flexcf.3.Park"> <mx:method name="getItems" result="getParksSuccess(event)" fault="fault(event)" /></mx:RemoteObject>
-
-
3
Add the combobox as the pull-down menu item. The following code uses the "getItems" object to populate the menu:
<mx:ComboBox dataProvider="{getItems}" labelField="{menu_items}" width="320" left="10" top="40"/>
-
1