Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

157
Visualizações
receive multiple form selection values on netlify

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

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda