I am looking to grab a string value from a text box and multiple values from a multiselect list and associate them where the string value is the key, and the multiple values from the drop down list are the values.
Here is the javascript code I have thus far:
var serviceName = document.getElementById('servicePackageText').value;
var sourceType = document.getElementById("multiple-checkboxes");
var groupName = serviceGroupName;
var serviceArray = new Array();
for (i = 0; i < sourceType.selectedOptions.length; i++) {
serviceArray.push(parseInt(sourceType.selectedOptions[i].value));
}
I want the format to look like this:
"Textbox value": [
multiselect_values,
multiselect_values,
multiselect_values,
multiselect_values
]
Any tips on how to proceed?
<>in question editor to make it runnable within this page