Solved

Multiple Dynamic Select Box

Posted on 2004-04-30
2
345 Views
Last Modified: 2013-12-24
Hi.

I am trying to do a multiple dynmaic select box, involving 3 tables.  The first one of the drop-down boxes work and I get the second option, however, I am having problems retrieving the third option.

This is the criteria:
   1) User selects from list of publications- box 1
   
   2) Upon selecting from box 1, the list of available articles for that publication appear

   3) If there additional pages for the main page of the publication, then the user should be able to select from the sub page of 2 and get the corresponding add-on pages.

I reviewed a great tutorial from easycfm.com, but it does not seem to work for more than 2 tables:

      <cfif isDefined('form.select_Main_Group')>
            <cfset page.select_Main_Group=form.select_Main_Group>
      </cfif>
      
            <cfif isDefined('form.select_Sub_Group')>
            <cfset page.select_Sub_Group=form.select_Sub_Group>
      </cfif>
      
                  <cfif isDefined('form.select_Sub_Group2')>
            <cfset page.select_Sub_Group2=form.select_Sub_Group2>
      </cfif>
      
      
      <cfoutput>
      <form name="DropDown" method="post">
      <table cellpadding="2" cellspacing="2">
      <tr>
     <td class="boldtext" valign="top">Publication:</td>
      
                  <cfquery name="get_Main_Group" datasource="#application.dsn#">
                  SELECT storyCatID, category
                  from StoryCategories
                  </cfquery>
                              
                  <td class="text" valign="top">
            <select name="select_Main_Group" required="yes" onChange="this.form.submit()">
            <option>---Publication----</option>
                                          
                  <cfloop query="get_Main_Group">
                  <option value="#storyCatID#" <cfif isDefined('form.select_Main_Group')>
                  <cfif form.select_Main_Group eq "#storyCatID#">
                  selected</cfif></cfif>>#category#</option></cfloop></select>
                              </td>
                              
                              <!--- 2nd combo box --->
                                    <cfif isDefined('page.select_Main_Group')>                                    
                                    <cfquery name="get_Sub_Group" datasource="#application.dsn#">
                                          SELECT *
                                          FROM storyFeeds
                                          WHERE storyFeeds.storyCatID=#page.select_Main_Group#                                    
                                    </cfquery>
                                    
                                    <td valign="top" class="text">
                  <select name="select_Sub_Group" required="yes" onChange="this.form.submit()">
                                          <cfloop query="get_Sub_Group">
                  <option value="#storyID#" <cfif isDefined('form.select_Sub_Group')>
                  <cfif form.select_Sub_Group eq "#storyID#">
                  selected</cfif></cfif>>#title#</option></cfloop></select>                                                                                          
                                    </cfif>
                                    
                                    <!--- 3rd combo box --->
                                    <cfif isDefined('page.select_Sub_Group')>
                                    <cfquery name="get_Sub_Group2" datasource="#application.dsn#">
                                          SELECT *
                                          FROM storyFeeds, storyPages
                                          WHERE storyPages.storyID=#page.select_Sub_Group#            
                                    </cfquery>
                                    
                                    <td valign="top" class="text">
                                    <select name="select_Sub_Group2" required="No" >
                                          <option>-----Title----</option>
                                          <cfloop query="get_Sub_Group2">
                                                <option value="#storyID#">#page#</option>
                                          </cfloop>                                          
                              </select>                                                                                                
                                    </cfif>                                    
                                    </form>
                                    </cfoutput>                  
                              </td></tr></table>
                              </td>                                    
                        </tr>

0
Comment
Question by:synergeticsoul
2 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 500 total points
ID: 10964021
Have you tried the CF_ThreeRelatedSelects tag?

On Macromedia Extentions Exchange download the free cold fusion tag : (Note I shortened the URLs, but they are from the official Macromeida site)

3 Related Selects :
http://tinyurl.com/ys839
0
 

Author Comment

by:synergeticsoul
ID: 10976851
Thank You.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

757 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

23 Experts available now in Live!

Get 1:1 Help Now