Bonjour,
J'ai un tableau dans lequel sur le clic du bouton créer apparait une ligne vide.
j'ai créé dans mon tableau un tr avec 5 td, le tr étant en disply block. Lors du clic, la ligne apparait, mais pour ff, tous les td ne comptent pas, il met toutes les cases dans la même colonne.
Voici le code
html
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 <table> <form method="post" name="Fs" action='' id="forms"> <tr id="tr[<?php echo $i ?>]" > <td width="5%" > <input type="checkbox" id="cb[<?php echo $i ?>]" name="cb[<?php echo $i ?>]" value="<?php echo $cod[$i]; ?>" onClick="activSup(<?php echo $nbl ?>, 'page69.php')" /> </td> <td width="10%" > <?php echo $cod[$i]; ?> </td> <td width="58%" class="modif" onDblClick="inlineMod(<?php echo $i ?>, <?php echo $cod[$i] ?>, 'MotifsEntree', this, 'Texte', 'tc10', 'CodeEntree')" > <?php echo $lib[$i]; ?> </td> <td width="5%" align="right" style="border:none; display:none" id="val[<?php echo $i?>]" ><button> <img src="images/valider1.png"/> </button> </td> <td width="5%" align="right" style="border:none; display:none" id="ann[<?php echo $i?>]" ><button> <img src="images/quitter1.png"/> </button> </td> </tr> </form> <form method="post" name="Fc" action='' id="formc"> <tr style="display:none" class="ligbleu" id="tr[<?php echo $n ?>]"> <td width="5%" ></td> <td width="10%" ><input type="text" name="cod" value="" id ="co[<?php echo $n ?>]"></td> <td width="58%" ><input type="text" name="lib" value=""></td> <td width="5%" class="modif" align="right" style="border:none; display:none" id="val[<?php echo $n?>]"><button> <img src="images/valider1.png"/> </button></td> <td width="5%" class="modif" align="right" style="border:none; display:none" id="ann[<?php echo $n?>]"><button> <img src="images/quitter1.png"/> </button></td> </tr> </table>
et js
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 function creTab(numlig, pag){ var idlig = 'tr['+ numlig +']'; var nvcod = 'co['+ numlig +']'; //Nom des boutons annuler et valider var annul = 'ann['+ numlig +']'; var valid = 'val['+ numlig +']'; var btnVal = document.getElementById("vali"); var btnAnn = document.getElementById("annu"); document.getElementById(valid).style.display = 'block'; document.getElementById(annul).style.display = 'block'; btnVal.disabled = false; btnAnn.disabled = false; document.getElementById(idlig).style.display = 'block'; document.getElementById(nvcod).focus(); document.getElementById(nvcod).select(); document.getElementById(valid).onclick = function () { document.getElementById('formc').action = pag+'?A=Cre'; document.getElementById('formc').submit(); };
et le bouton créer
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 <button id="cre" onClick="creTab(<?php echo $n ?>,'page69.php')" ><img src="images/creer1.png" /> Créer</button>
et sur FF, ce script s'exécute sans me permettre de saisir mes infos !
Partager