davestacey
10/22/2014 - 9:10 PM

building a select list from json

building a select list from json

// Process the overlay data - Controller
function weHaveJSONData(jsonData){
  //console.log('we Have json', jsonData);
  var option;
  $.each(jsonData, function(index) {
    option += "<option value='"+index+"'>"+jsonData[index]+"</option>";
  });
  $('select#edit-submitted-u-name-u-name').html(option);

} //function weHaveJSONData