?
Solved

Multiple Dynamic Select Box

Posted on 2004-04-30
2
Medium Priority
?
353 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 35

Accepted Solution

by:
mrichmon earned 2000 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

777 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