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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:01:35+00:00 2026-06-05T00:01:35+00:00

I am still learning javascript and xml and have recently been presented with an

  • 0

I am still learning javascript and xml and have recently been presented with an issue I’m sure is simple to solve. I’m hoping for some help on this if possible.

I have an xml file that is found here

http://mrblesid.com/blueprint/bookinglist.xml

I’m currently using this code to create a drop down list featuring the values from just one of the attributes “strArtistName”

$(document).ready(function(artists){
$.ajax({
    type: "GET",
    url: "bookinglist.xml",
    dataType: "xml",
    success: function(artists_list) { 
        var select = $('#mySelect');
        $(artists_list).find('vw_ADM_BookingListNull[strArtistName]').each(function(){
            var artists = $(this).attr('strArtistName');
            select.append('<option value="'+artists+'">'+artists+'</option>');
            });
    select.children(":first").text("please make a selection").attr("selected",true);
    }
    });
});

This is then called into a dropdown via the following

<form>
  <select id="mySelect">
  <option>loading</option>
  </select>
</form>

I would like to avoid repeating the artist names that are found for every entry, am I right to think I would need to use an array for this? If so how do I go about it?

The name selected from the list should populate a variable to use elsewhere in the report.

Any help would be greatly appreciates as I have deadlines looming.

Thanks in advance,
Mikey

  • 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-05T00:01:37+00:00Added an answer on June 5, 2026 at 12:01 am

    An array will work. Update the main part to

    var artistsArr = [];
    $(artists_list).find('vw_ADM_BookingListNull[strArtistName]').each(function(){
        var artists = $(this).attr('strArtistName');
        if ($.inArray(artists, artistsArr) == -1) {
            select.append('<option value="'+artists+'">'+artists+'</option>');
            artistsArr.push(artists);
        }
    });
    

    Some browsers don’t support Array.indexOf, so you can use jQuery’s inArray.

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

Sidebar

Related Questions

Still learning JSP Web Applications here. I have been doing this for a while
Ok I am still learning this... I have Googled and done some research but
I've just recently begun learning XML in the context of PHP and Javascript, and
I recently started learning JavaScript and I've been a frequent user of jsfiddle since
I am learning Javascript, I have been using PHP for about 10 years so
I've been broadening my horizons learning javascript and I have a quick question about
I am still learning the tricks to jQuery mobile and have been having a
I'm still learning JavaScript,reading books,utilizing FireBug,experimenting. I'm amazed and stuck on thing below. Have
Still learning WPF....thanks for any help. Is there any way to Refactor this: <ListBox
I'm still learning about Objective-C memory management. I'm trying to implement several simple classes

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.