How to fill a bomboox by click another combobox

Posted on 2006-05-05
Last Modified: 2013-12-24
Language: Coldfusion MX 6.1

I have a form that has 2 comboboxes. First one is country and fills countries from database. And another one is states combobox. When users click country combobox and select a country - eg. USA, then the states combobox will fills all status of USA from database.

It is very comm in real world. This can be done very easy in .net application because there is a "combobox_click" action. But html does not have "control"s, so how can I do this in my coldfusion mx 6.1 application?

Question by:bvwang
    LVL 24

    Expert Comment

    You need to use javascript
    How it works is you write a javascript array filled with the data from your coldfusion queries.
    Here is a pre-built function for sale

    Good luck ...
    LVL 3

    Author Comment

    I do not want buy anything from Internet. Any one has good ideas?
    LVL 3

    Author Comment

    If anyone could answer this question I would like to double the points!!!!!!!!!!!!!!!!!!!
    LVL 24

    Expert Comment

    It's not just a simple answer.
    You have to write a javascript array and populate it with a coldfusion query output.
    If you research how to write the array you'll probably find examples.
    You can then replace the hard-coded array elements with your coldfusion query output.
    LVL 3

    Author Comment

    do you have the javascript code?
    LVL 10

    Expert Comment

    Here are 3 links to get you on your way:
    - Pure coldfusion, but would require a page reload
    - ASP + Javascript, so you will need to use your ASP knowledge to port this over to coldfusion
    - CF_TwoSelectsRelated, a FREE coldfusion extension ready for download
    LVL 4

    Accepted Solution

    well, you can try this:
       window.location = "yourpage?filldropdownbox=yes";

    this script reload your page and the u can use cf to chatch the vriable "filldropdownbox" and then do your bussiness int cf.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    Writing .htaccess to redirect only the index page 3 67
    Website Test Question 6 90
    SCCM vs Windows server 5 59
    Summernote required 3 19
    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 …
    Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
    The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following:…
    The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

    759 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

    10 Experts available now in Live!

    Get 1:1 Help Now