Here are my solution with JS
var add = document.getElementById("Adicionar");
var addProduto =
document.getElementById("Kits_ID_EntradaProdutoEstoque__row");
var addQuantidade =
document.getElementById("Kits_QuantidadeProdutos_grow_input");
var produtos = document.getElementById("Kits_ID_EntradaProdutoEstoque");
add.addEventListener('click', adicionar)
function adicionar(){
//inputs que serão criados ao apertar o botão de adicionar
var produtoNome = document.createElement('select');
var produtoQuantidade = document.createElement('input');
var li = document.createElement("li");
addProduto.appendChild(produtoNome);
produtoNome.className = "form-control produto";
produtoNome.id="Kits_ID_EntradaProdutoEstoque";
produtoNome.name = "ID_EntradaProdutoEstoque";
addQuantidade.appendChild(li);
li.appendChild(produtoQuantidade);
produtoQuantidade.className = "form-control integer";
for(var x = 0; x <= produtos.options.length; x++ ){
var newoption = document.createElement("option");
newoption.value = produtos.options[x].value
newoption.text = produtos.options[x].text;
produtoNome.add(newoption);
}
}
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.