1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| function ajouter_tache(){
var conteneur = document.getElementById('tache_client');
var tache_div = document.createElement('div');
var check = document.createElement('input');
var produit = document.createElement('input');
var add_pj = document.createElement('img');
check.type = 'checkbox';
produit.name = 'produit[]';
produit.type = 'text';
produit.size = '60';
produit.value='Produit';
add_pj.src = 'images/add_pic.png';
add_pj.onclick = function(){
var undiv = document.createElement('div');
var fichs = document.createElement('input');
var checks = document.createElement('input');
fichs.name = 'pjs[]';
fichs.type = 'file';
checks.type = 'checkbox';
checks.onclick = function(){
lefieldset = undiv.parentNode;
lefieldset.removeChild(undiv);
}
undiv.appendChild(fichs);
undiv.appendChild(checks);
undiv.appendChild(document.createTextNode("Enlever"));
conteneur.appendChild(undiv);
}
check.onclick = function(){
lefieldset = tache_div.parentNode;
lefieldset.removeChild(tache_div);
}
tache_div.appendChild(produit);
tache_div.appendChild(add_pj);
tache_div.appendChild(check);
tache_div.appendChild(document.createTextNode("Enlever"));
conteneur.appendChild(tache_div);
} |
Partager