Ca y est je l'ai eu:
Pour ceux que ca peut interrésser:
En fait je fesais la boucle WHILE autour des balises <script></script>
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 <?php $reqtarifs = mysql_query("SELECT * FROM tarifs"); ?> <script type="text/javascript"> data = { <?php while ($tarifs = mysql_fetch_array($reqtarifs)) { ?> '<?php echo $tarifs['Designation']; ?>': ['<?php echo $tarifs['Designation']; ?>','<?php echo $tarifs['Unite']; ?>','<?php echo $tarifs['Prix']; ?>'], <?php } ?>}; </script> <script type="text/javascript"> function change_Designation(Ligne,Mot) { document.getElementById('Quantite'+Ligne).value = Ligne; document.getElementById('Unite'+Ligne).value = data[Mot][1]; document.getElementById('Prix'+Ligne).value = data[Mot][2]; } </script>
Allez "Résolu"
Merci sekaijin et NoSmoking![]()
Partager