Cascading dropdown in coldfusion

Include latest version of jQuery in your page with following javascript code:

    <script type="text/javascript">
        function fun_changeCustomer(customerId) {
            var url = '';
            url = "/cfc/customerBillingAddressGateway.cfc?";
            url = url + 'method=getAddressInfoByCustomerIdQuery&returnFormat=json&argumentCollection={"customerId": ' + customerId + '}';
            jQuery.getJSON(url, function (data) {
                $.each(data.DATA, function (index, optionData) {
                    if ('#form.billingAddress#' == optionData[0]) {
                        $("#billingAddress").append("" + optionData[1] + "");
                    else {
                        $("#billingAddress").append("" + optionData[1] + "");

Your cfc class (here: customerbillingAddressGateway.cfc) should have following method with remote access:
cffunction name=”getAddressInfoByCustomerIdQuery” access=”remote” output=”false” returntype=”query”

It should contain a normal select query that returns the addressId and addressInfo.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s