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
|
<script type="text/javascript">
function ajouter() {
var nom_fieldset = document.getElementById('choix_photo');
var calque = document.createElement('div');
var champ_ref_img = document.createElement('input');
champ_ref_img.name = 'les_photos[]';
champ_ref_img.type = 'text';
champ_ref_img.setAttribute('size','50');
var champ_utilisation = document.createElement('textarea');
champ_utilisation.name = 'les_utilisations[]';
champ_utilisation.setAttribute('rows','10');
champ_utilisation.setAttribute('cols','50');
var case_a_cocher = document.createElement('input');
case_a_cocher.type = 'checkbox';
case_a_cocher.onclick = function() {
le_calque_a_supprimer = this.parentNode;
lefieldset = le_calque_a_supprimer.parentNode;
lefieldset.removeChild(le_calque_a_supprimer);
}
calque.appendChild(champ_ref_img);
calque.appendChild(document.createElement('br'));
calque.appendChild(champ_utilisation);
calque.appendChild(document.createElement('br'));
calque.appendChild(case_a_cocher);
calque.appendChild(document.createTextNode(" Supprimer"));
calque.appendChild(document.createElement('br'));
calque.appendChild(document.createElement('br'));
nom_fieldset.appendChild(calque);
}
</script> |
Partager