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 7704387
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:40:08+00:00 2026-05-31T23:40:08+00:00

Let me preface this question. I have just started using jquery, so please be

  • 0

Let me preface this question. I have just started using jquery, so please be kind.

I have searched for this answer, and I cannot seem to find anything that works, so I’m asking the question here.

I am going to have a page that contains a group of select boxes that will populate a list of check boxes based on which option in the select is chosen. I haven’t got that far yet. All I got so far is using the $.ajax to retrieve the data from the server. If I view the firebug console I see my JSON string.

{"DESCRIPTION":"Global Alpha I Benchmark","INCEPTION_DATE":"2004-02-29 00:00:00.0","DISCLOSURE":"","BENCHMARK_ID":"EBDVGA1INDEX"}

Here is the javascript:

    $(document).ready(function(){
    $(':input:visible:enabled:first').focus();
    $(function(){
        $("select#benchmarks").change(function(){
            var formval = {benchmarks:$(this).val()}
            $.ajax({
                type:"POST",
                data: formval,
                url: "request_processor.cfm",
                datatype: "json",
                success:$(function(response){alert(response);})

            });
        });
    });
});

HTML:

<cfform name="testForm">
<div align="center" id="databox">
    <cfselect id="benchmarks" name="benchmarks" query="getBenchmarks" queryPosition="below" value="benchmark_id" display="benchmark_id">
        <option value="">Please Select an ID...</option>
    </cfselect>
    <cfselect id="myselect" name="myselect"></cfselect>
</div>
<div id="contentdiv"></div>

I have mucked something up, and now I can’t even get data to show on the screen, so I don’t know what to do. Any help would be appreciated. \

UPDATE:

@Rob

I have added the following to the success portion of the ajax call.

$.each(response,function(index){
options = "<option value='"+ response.description + "'>" + response.description + "</option>"
});
$("select#myselect").html(options);    

Now nothing happens! No javascript error, no errors in the firebug console.

  • 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-31T23:40:09+00:00Added an answer on May 31, 2026 at 11:40 pm

    I see a few issues with your “each” code. First of all, based on your JSON string originally posted, you have a single object. Unless you wrap it in [], .each will iterate over each property, such as description and inception date. If it’s wrapped in brackets, it will iterate over it as if it is an array, once for each item in the collection.

    So, assuming you pass it an array, your code should look like:

    var options = '';
    $.each(response, function(){
        options += "<option value='"+ this.DESCRIPTION + "'>" + this.DESCRIPTION + "</option>";
    });
    $("select#myselect").html(options);
    

    I’ve made two changes. First, I concatenate to the options string, so all options are collected. I’m also using “this” to point to the correct item within the loop.

    Edit: I’ve also changed the case of DESCRIPTION. I believe it’s case-sensitive.

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

Sidebar

Related Questions

Let me preface this question and state that using Entity Framework is not an
Let me preface this question by saying I use TextMate on Mac OSX for
Let me preface this question by saying I've exhausted Google, or at least what
First off, let me preface this question by stating that I'm really a pretty
Let me preface this by saying that I'm pretty new to Java. I have
Let me preface this question by stating that I'm not a C# developer. I'm
Ok this may be a silly question for many of you. Let me preface
Ok guys, let me preface my question with this, This is not a technical
Let me preface this by saying that I know the ContactCenter sample is just
Let me preface this by saying I have no knowledge of Java. I am

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.