Custom Dropdown from Ajax call

Hi
when a page loads i would like to populate a drop down field from the results from a ajax call

i have added this to Startup script
customer= ‘SystemTEN’;
$.ajax({
url: ‘getUserList.php’,
type: ‘POST’,
data: {customer: customer},
success:function(result)
{
var options;
var data = JSON.parse(result);
$(“#x_customeruserid”).val(result);
}
});

it is returning the results just not sure how to populate the dropdown field
can anyone help me out

thanks

Show the response from the Ajax request first. For example:

var data = JSON.parse(result);
console.log(data);

return is
Array(4) [“user1@xxx.com”,“user2@xxxxx.com”,“user3@rexxxxxdcentricplc.com”,“user4@xxxxx.com”]

For the field it is set as a SELECT with nothing ticked

half working with this, but on save it does not write the x_customeruserid value into the database

success:function(result)
{
var options;
var data = JSON.parse(result);
var JSONObject = JSON.parse(result);
newOptionsSelect = ‘’;
for (var key in JSONObject) {
if (JSONObject.hasOwnProperty(key)) {
var newOptionsSelect = newOptionsSelect + ‘’+JSONObject[key]+‘’;
}
}
$(‘#x_customeruserid’).append( newOptionsSelect );
}