Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3997900
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:27:31+00:00 2026-05-20T07:27:31+00:00

Hi I have a form select bound to a cfc – i can see

  • 0

Hi I have a form select bound to a cfc – i can see the json returned but its not displaying on my form – i have the code as below hope someone can help:

FORM

<script type="text/javascript">
// <!--
$(document).ready(function()
{
$("#CountriesList").change(function()
{
if($(this).val() != '')
{
$.ajax({
type: "POST",
url: "mycfc.cfc?method=GetCities&returnformat=json",
data: ({
CountryID: $(this).val()
}),
dataType: "xml",
success: function(xml)
{
$('#Cities option').remove();
$(xml).find('record').each(function()
{
$("#Cities").append('<option value="' + $(this).find('tape_width').text() + '">' + $(this).find('tape_width').text() + '<\/option>');
});
}
});
}
});

})

// -->
</script>

<cfsilent>
<cfinvoke component="mycfc" method="CountriesList" returnvariable="CountriesList"/>
</cfsilent>
 <cfoutput>
 <label for="CountriesList">Select Country:</label>
 <select name="CountriesList" id="CountriesList">
<option value="" selected="selected">...</option>
 <cfloop query="CountriesList"><option value="#BAND#">#CountriesList.BAND#</option></cfloop>
</select>
<label for="Cities">Select City:</label>
<select name="cities" id="Cities"><option value="">...</option></select>
</cfoutput>

The actual CFC is as below:

<cfcomponent>
<cffunction access="remote" name="CountriesList" output="false" returntype="query">
<cfquery name="SelectAllCountries" datasource="test">
 SELECT DISTINCT BAND
 FROM FABRICS
 WHERE TYPE='venetian'
 AND isACTIVE='true'
 ORDER BY BAND
</cfquery>
<cfreturn SelectAllCountries>
</cffunction>
<cffunction access="remote" name="GetCities" output="false" returntype="query">
<cfargument name="CountryID" required="yes" type="any" default="" />
<cfquery name="Cities" datasource="test">
 SELECT TAPE_WIDTH
 FROM tapes
 WHERE SLAT_WIDTH='#arguments.CountryID#'
</cfquery>
<cfreturn Cities>
</cffunction>
</cfcomponent>

Could someone point out where am going wrong please?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:27:32+00:00Added an answer on May 20, 2026 at 7:27 am

    I fixed a similar problem I was jhaving by adding queryformat as follows:

    $.getJSON("getContacts.cfc?method=getContacts&returnformat=json&queryFormat=column
    

    prior to this I was seeing the json being returned (through firebug) but it was not dipslaying…

    Hope it helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The select form component in grails can have the form: <g:select name=user.age from=${0..59} value=${age}
i have two dropdown list. first drop down:1 enter code here <form:select path=custName id=custName>
i have a form that has a multiple select drop down. a user can
I have a form where a subscriber can select the newsletters they want to
I have a data-bound combobox on a Windows form. When I select an item,
I have some problems sending an id though jquery. I have a form select
I have a select form element with 5 options. If option 2 is selected
I have a form with 3 select elements. Each one, by default, has option
I have a form with a country select. The form should be extended with
I have a form with image thumbnails to select with checkboxes for downloading. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.