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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T10:41:36+00:00 2026-06-08T10:41:36+00:00

I need a radio button to change a dropdown and have most if it

  • 0

I need a radio button to change a dropdown and have most if it working just not sure about a few things. I want to have CreativeID as the ID and CreativeName as the name. Here’s my AJAX:

$('input[name=creativeType]').change(function(){
        $.ajax({
            url: '/app/components/MailingsReport.cfc',
            //POST method is used
            type: "POST",
            //pass the data 
            data: {
                method: "getCreative",
                CreativeType: $('input[name=creativeType]:checked').val(),
                datasource: "shopping_cart"
                 },
            dataType: "xml",
            //contentType: "application/text; charset=utf-8",
            success: function(xml){
                $('#creative option').remove();
                    $(xml).find('number').each(function()
                    {

$("#creative").append('<option value="' + $(this).text() + '">' + $(this).find('CREATIVENAME').text() + '<\/option>');

                    });                
            }
        });

Here’s my return data:

<wddxPacket version='1.0'><header/><data><recordset rowCount='3' fieldNames='CREATIVEID,CREATIVENAME' type='coldfusion.sql.QueryTable'><field name='CREATIVEID'><number>52.0</number><number>65.0</number><number>77.0</number></field><field name='CREATIVENAME'><string>Product One</string><string>Product Two</string><string>Product Three</string></field></recordset></data></wddxPacket>

My Question: I just have no idea how to populate the dropdown so the ID is the value AND the product name shows between the option tags.
Any help on this would be appreciated!

  • 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-06-08T10:41:38+00:00Added an answer on June 8, 2026 at 10:41 am
    var numbers = $(xml).find('number');
    var strings = $(xml).find('string');
    for (var i = 0; i < numbers.length; i++) {
        $("#creative").append('<option value="' + numbers[i].innerHTML + '">' + strings[i].innerHTML + '<\/option>');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a list of radio button, not radiobuttonlist, I need to find out
I need to change the bg color of a div containing a radio button
usual but I need to have different custom radio button images per button. So
I have a radio button that is generated dynamically on the page. I change
I have following code which works for radio buttons but need to be changed
I need to send some data with radio button. This buttons are <td> <span
I need to place the label text to left and the radio button to
I need to get the class attribute of checked radio button, with name=radio. Used
i have 3 radio buttons.what i need to do is that when one radio
I have got a group of radio buttons that when clicked need to display

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.