Solved

Multiple Dynamic Select Box

Posted on 2004-04-30
2
349 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IPA - can it be run on a web server? 3 207
AWS New EC2 Instance and EBS Storage 2 85
SSL sertificate 5 71
Company website 6 30
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…
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…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

830 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