Solved

Database driven & dynamic dropdown menus

Posted on 2003-10-29
15
1,107 Views
Last Modified: 2013-12-20
Hello. I need to have three dropdown menus on my site.  The content will be database driven (using SQL Server) and depending on the choice made on menu1, menu2 will dynamically change, and depending on the choice made on menu2, menu3 will change.  I'm not sure how to do this with ColdFusion. Any help would be appreciated.

Thanks in advance.
0
Comment
Question by:RSebastiani
  • 5
  • 5
  • 3
  • +1
15 Comments
 
LVL 4

Expert Comment

by:procept
ID: 9644016
Hi,

here's a little tutorial I wrote with two related selects. Can easily be expanded to make three selects. ;-))

http://www.procept.net/index.cfm?page=coldfusion/tutorials/dynSelect/index

Feel free to ask if you need help in adding one more select.

HTH,

Chris
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9644065
theres a tag for this CF_THREESELECTSRELATED !

this wld do it for u !
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9644101
go to http://www.geocities.com/thanny/ & scroll to bottom right of the page !

& u shld be able to download the tag & use it easily :)

HTH

K'Rgds
Anand
0
 
LVL 9

Expert Comment

by:CFDevHead
ID: 9645343
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9647760
One cld easily write a customised array function !

I did the same till i found the tags ... why create them when they can do it easily for u :)
0
 
LVL 4

Expert Comment

by:procept
ID: 9648311
Anand,

> why create them when they can do it easily for u :)

Because it's easier to learn and understand when you code it yourself. ;-))

Chris


0
 
LVL 17

Expert Comment

by:anandkp
ID: 9648862
I believe there's no point in reinventing the wheel ... !
One shld just know how to use it - thats all ...

depends how u look at it ... cos of all the 10000.. tags available - if a person goes to write all of them by himself ... pheeeww ...

Cheers
Anand
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:RSebastiani
ID: 9652429
First of all, thanks everybody for your answers.  

I'm trying the CF_THREESELECTSRELATED tag first.  Anand, I went to the link you posted and downloaded a zip file. I changed all the options accordingly but when I try to run it , the error I get is that I didn't specify Attributes.Query, but I did.  I'm not sure where I'm supposed to place the tag code.  Right now I have everything in one page, the code from ThreeSelectsRelated.cfm, the query and the form.  What am I doing wrong?

Thanks!!!!!
0
 

Author Comment

by:RSebastiani
ID: 9653103
CFDevHead,

Ok, I'm using the script but I don't want it to redirect to another page. What lines do I need to remove? I'm trying but I keep getting errors.

Thanks!
0
 
LVL 9

Expert Comment

by:CFDevHead
ID: 9653121
take out this function
function redirect2(z){
window.location=temp1[z].value
}
0
 

Author Comment

by:RSebastiani
ID: 9653208
I did but when I make the selection on the third select box, I get the Object Expected error. Any ideas why? Thanks.
0
 
LVL 9

Accepted Solution

by:
CFDevHead earned 250 total points
ID: 9653260
on the thrid select box get rid of the onChange="redirect2(this.options.selectedIndex)"
0
 

Author Comment

by:RSebastiani
ID: 9653330
Duh. I feel stupid. Thanks!
0
 

Author Comment

by:RSebastiani
ID: 9653844
CFDevHead,

I have a new problem. When I submit my form to the database, the only data written into the database is select box #1.  select boxes #2 and #3 are blank.  Any ideas on how to fix this one?

Thanks.
0
 
LVL 17

Expert Comment

by:anandkp
ID: 9655311
Just give urself some time in understanding how the tag works !

Read thru all teh files it has for reference & try it out ... it may look difficult at the first go ... but give it a try & it shld work out !
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to manually back up a WordPress Database. This will be demonstrated using a Windows 8 PC. The Host used will be IPage.com Log into your Hosting account. IPage will be used for demonstration : Locat…

920 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

16 Experts available now in Live!

Get 1:1 Help Now