i have a form that have a multiple select menu, when i submit the form i recieve only the first value,
function form(){
var subjectObject = {
"Training Pack(s)": ["Stellar Pack", "Professional Pack", "Expert Pack"],
"Business Pack": ["Business Pack"],
"ICT Solutions": ["Web Development", "Networking Solutions", "Data Analytics"],
"1-1 Sessions": ["Professional CV Writing & Templates", "Job Seeking Skills", "Interview/Test Preparation", "Business Startup Skills", "MS Excel Advanced Session", "MS Word & PowerPoint", "Project Management Introduction", "Presentation & Coaching Skills", "Sales Techniques"],
"Materials": ["Job Application Materials", "Professional CV", "Proposal Writing"]
}
var subjectSel = document.getElementById("service");
var topicSel = document.getElementById("topic");
for (var x in subjectObject) {
subjectSel.options[subjectSel.options.length] = new Option(x, x);
}
subjectSel.onchange = function() {
topicSel.length = 1;
var z = subjectObject[subjectSel.value];
for (var i = 0; i < z.length; i++) {
topicSel.options[topicSel.options.length] = new Option(z[i], z[i]);
}
}
}
Html:
<form name="contact" netlify>
<div class="row">
<div class="optional">Services Section (optional):</div>
</div>
<div class="select-menus">
<div class="row">
<select name="service" id="service" class="select-menu">
<option value="" selected="selected">Select Service</option>
</select>
<select name="topic" id="topic" class="select-menu" multiple size="1">
<option disabled>Select Topic (Hold 'Ctrl' For Multiple Select)</option>
</select>
</div>
</div>
<input type="submit" value="Send" class="submit-button">
</form>
it sends me the form submission with only first checked value of this
<select name="topic" id="topic" class="select-menu" multiple size="1">
<option disabled>Select Topic (Hold 'Ctrl' For Multiple Select)</option>
</select>
but what i want is , to receive all of the selected/checked values