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
javascript getelementbyid appendchild elements not accessible

I'm having a problem with creating multiple clones of one big fieldset, I am making multiple instances of the same div according to elements in a selectlist, and the child elements I am creating have textfields that are not accessible any more, here is my code:

var qFieldsId= 0;
$("#IBlist option").each(function () {
    qFieldsId++;
    var select = document.getElementById("qId");
    var clone = select.cloneNode(true);
    clone.setAttribute("id", "qId" + qFieldsId);
    document.getElementById("qFieldsId").appendChild(clone);
}); 

I am having the new instances correctly but the problem is, many textareas to fill and fields are not clickable or editable at all, here is an example of one in the original instance of the div:

<div class="form-group col-md-3" data-bind="validationElement: CCommission,visible: CCommissionVisible()">
    <label for="CCommission" class="control-label required">Confirmation Commission</label>
    <span class="form-control "
data-bind="visible: !editingCCommission(), text: global.formatAsDecimal(CCommission(),CCommissionDecimal()), click: editConfirmationCommission"></span>
    <input type="number" class="form-control " data-bind="visible: editingCCommission, value: CCommission, hasFocus: editingCCommission" />
</div>

I don't know if this problem is caused by the Ids of each new field or what exactly and I couldn't find a solution for the bug.

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