mardi 8 août 2017

textfield dynamic checkbox

anyway to integrate the solution http://ift.tt/2hI5CB3 with Bootstrap Switch http://ift.tt/2rafrMG I just cant quite get the textfield to appear when I set the switch to on. Thanks

<script type="text/javascript">
 function dynInput(cbox) {
  if (cbox.checked) {
    var input = document.createElement("input");
    input.type = "text";
    var div = document.createElement("div");
    div.id = cbox.name;
    div.innerHTML = "Text to display for " + cbox.name;
    div.appendChild(input);
    document.getElementById("insertinputs").appendChild(div);
  } else {
    document.getElementById(cbox.name).remove();
  }
}
</script>




Aucun commentaire:

Enregistrer un commentaire