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
| function calcul_formu(formul){
/*var qte = new Array(qte1[, qte2]);
var prix = new Array(prix1[, prix2]);
var mt = new Array(montant1[, montant2]);*/
var qte= document.getElementById('quantite').value;
var prix= document.getElementById('pu').value;
var mt = document.getElementById('montant').value;
mt=qte*prix;
...
php
<?php
$no=array();
for($no=0; $no<=11; $no++)
{
echo "<tr height='30px' width='10px'>";
echo "<td>";
echo "<input type='text' name='quantite[$no]' id='quantite' onkeyup='return calcul_formu(this);' style='width:100px' style='height:30px'/>";
echo "</td>";
echo "<td>";
echo "<input type='text' name='description' value='' style='width:600px' style='height:30px'/>";
echo "</td>";
echo "<td>";
echo "<input type='text' name='pu[$no]' value='' id='pu' onkeyup='return calcul_formu(this);' style='width:100px' style='height:30px'/>";
echo "</td>";...... |
Partager