Create a drop down from an xml file, with no repeated values. Do I need an array?

SpiffType

New Member
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.xmlI'm currently using this code to create a drop down list featuring the values from just one of the attributes "strArtistName"\[code\]$(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); } });});\[/code\]This is then called into a dropdown via the following \[code\]<form> <select id="mySelect"> <option>loading</option> </select></form>\[/code\]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
 
Back
Top