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

237
Visualizações
Form Data Select passing 'undefined'

I am having an issue with my Form Submit function

Everything is submitting as expected other than the 'Option' from my 'Select'.

It is getting passed through as 'Undefined'

I'm wondering if this is because the Options in the select are generated programmatically at runtime?

My code for the select is:

        <label for="devname">Developer Name:</label>
        <select id="devname" name="devname">
            <option  value="">Choose name..</option>
        </select><br><br>

The code i've got that generates the options is:

function populateSelect() {
    $.get('/GetDevs').done(function (devs){
        var index = 0;
        var selectme = document.getElementById('devname');
        for (index = 0; index < devs.length; ++index) {
            var dev = devs[index];
            var opt = document.createElement('option');
            opt.value = dev.Devid;
            opt.innerHTML = dev.dname;
            selectme.appendChild(opt);
        }
    });
}
populateSelect();

This successfully populates the option but as i say, when i post the form it gets passed 'undefined'

Any ideas would be appreciated

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