Skip to content

Instantly share code, notes, and snippets.

@wilcorrea
Created September 13, 2019 18:40
Show Gist options
  • Save wilcorrea/99c194bdce524d258b78f93fea04510c to your computer and use it in GitHub Desktop.
Save wilcorrea/99c194bdce524d258b78f93fea04510c to your computer and use it in GitHub Desktop.
window.procutList5 = []
function add5(quantidade_equipe = undefined, funcaoo = undefined) {
var quantidade = quantidade_equipe || document.getElementById("quantidade_equipe").value
var funcao = funcaoo || document.getElementById("funcaoo").value
window.procutList5.push({ quantidade, funcao })
var list = window.procutList5.map(function (item, index) {
return `<li>${item.funcao} ${item.quantidade}
<input
type="hidden"
name="funcaoo[${index}]"
value="${item.funcao}"
>
<input
type="hidden"
name="quantidade_equipe[${index}]"
value="${item.quantidade}"
>
</li>`
}).join('')
document.getElementById("list5").innerHTML = list
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment