[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 401
  • Last Modified:

How to create Dynamic ColdFusion Drop Down and SQL tables

I need to create two forms that will have multiple dynamic drop down boxes.  I am using cold fusion and not sure if I want to use straight html CF form or use a flash format form.  

The user would select a business type (or multiple business types) and then based on that selection, they would get a selection of regions to choose in a drop down, and then based on the region (or regions) they select, they would be presented with a list of locations (which they can have multiple selections too), then based on the location(s) they select, they will be introduced with a list of applications.  I included how the basic form would look below.

I need to create the SQL tables and the form for this...does anyone have any suggestions on websites that will assist in how to create the tables to easily sort this information out and build the form using dynamic selections?  

I have done some of this in the past but not to this extent...and when I did it, I don't think I did it the correct way (although it works).  So I'm trying to do this the 'standard' correct way so I'm not creating a duct-tape application.


<cfform action="" method="post" name="myForm">
<table border="0" cellspacing="0" cellpadding="5">
    <tr>
        <td colspan="3">
            <table width="100%">
            <tr>
                <th><strong>Business:</strong>&nbsp; &nbsp;</th>
                <td><b>Telephone:</b><input type="checkbox" name="bus1" value="">&nbsp; &nbsp;</td>
                <td><b>Wireless:</b><input type="checkbox" name="bus2" value="">&nbsp; &nbsp;</td>        
                <td><b>Cable:</b><input type="checkbox" name="bus3" value="">&nbsp; &nbsp;</td>       
                <td><b>Satellite:</b><input type="checkbox" name="bus4" value="">&nbsp; &nbsp;</td>       
                <td><b>Pager:</b><input type="checkbox" name="bus5" value="">&nbsp; &nbsp;</td>      
            </tr>
            </table>
    	</td>
    </tr>
    <tr> 
        <th align="right">
        	Region(s):
        </th>
        <td colspan="2"> 
            <select name="regions" multiple style="width:240px" size="4">
            <option value="">List of Regions</option>
            </select>					
        </td>
    </tr>
    <tr> 
        <th align="right">
             <a class="tiny" href="#">
                <b>Location(s) by Region</b>
            </a>
        </th>
        <td colspan="2">
            <select name="locations" multiple style="width:240px" size="4">
            <option value="">List of Locations</option>
            </select>
        </td>
    </tr>
    <tr> 
        <th align="right">
            Primary System:
        </th>
        <td colspan="2"> 
            <select name="systems" style="width:300px">
            <option value="">List of Systems</option>
            </select>							
        </td>
    </tr>
</table>
</form>

Open in new window

0
Lee R Liddick Jr
Asked:
Lee R Liddick Jr
  • 2
1 Solution
 
digicidalCommented:
As long as you are using CF8/9 and want to use the new AJAX controls - there is a great example on Ben Forta's blog that should get you started...

http://www.forta.com/blog/index.cfm/2007/5/31/ColdFusion-Ajax-Tutorial-2-Related-Selects

There are several other tutorials online as well... just google 'coldfusion related select query' and you should find more than you really need.

However, that being said - Ben is the lead resource to consult - if he or Ray Camden have something on their blogs, then I would consider it a 'best practice' in most things ColdFusion.
0
 
Lee R Liddick JrReporting AnalystAuthor Commented:
Let me take a look at this as we are moving to CF8 shortly.
0
 
digicidalCommented:
In general, I would highly recommend it - although you might as well move directly to CF9 (since it's out now, and then you will have the latest ExtJS stuff in there as well).  If nothing else, the speed of CF9 is a little better than CF8 - plus if you are planning on running the Enterprise edition, it's pricey - but the server management console is very nice for tuning applications - especially if you are running multiple sites/servers.

You can also (if you are staying with MX/7) just look into a manual implementation of ExtJS or JQuery to have the same AJAX functionality - it takes a little more effort to implement, but then you have complete control over it (at the expense of the RAD-ability of just using CFFORM to implement the same elements).

You can also simply do a manual javascript relationship by combining a <cfoutput> block with a javascript function embedded in it to set up your arrays for the related selects.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now