I have an XML source that was created like this:
<?xml version="1.0"?>
<response>
<fnotes><option value="">Select available time</option>
<option value="0600">06:00 AM</option>
<option value="0615">06:15 AM</option>
<option value="0630">06:30 AM</option>
<option value="0645">06:45 AM</option>
</fnotes>
</response>
Then my javascript looks like this:
var select = $('#sappttime');
$(xml).find('fnotes').each(function(){
var title = $(this).find('option').text();
select.append("<option/><option class='ddheader'>"+title+"</option>");
});
I want my select to have 4 values but it's returning as one complete value instead. I was thinking of 2 solutions to populate the select base on the source xml. 1 is the example above, 2 adding the value on my select as is (don't know how to do that as well though). Any help is appreciated. Thank you.
No comments:
Post a Comment