tengo un formulario que tiene un menú de selección múltiple, cuando envío el formulario recibo solo el primer valor,
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>me envía el envío del formulario con solo el primer valor verificado de este
<select name="topic" id="topic" class="select-menu" multiple size="1"> <option disabled>Select Topic (Hold 'Ctrl' For Multiple Select)</option> </select>pero lo que quiero es recibir todos los valores seleccionados/verificados