0
I can’t program in javascript
so I’d like a little help from you, on how to proceed in this case.
In this code below I would like to know how I make a dynamic calculator,
per line, equal to the example below. I just have to put the amount:
<table class="table table-bordered table-primary">
<thead>
<tr>
<th style="width: 20%;" >Cod</th>
<th style="width: 20%;">Data</th>
<th style="width: 10%;">Tipo</th>
<th style="width: 5%;">Quantidade</th>
<th class="text-center" style="width: 14%;">Valor | Desconto</th>
<th class="text-center" style="width: 14%;">Valor Total</th>
</tr>
</thead>
<tbody>
<?
$cmd = "SELECT * FROM cotacao";
$produtos = mysql_query($cmd);
$total = mysql_num_rows($produtos);
while ($linha = mysql_fetch_array($produtos)) {
$valor = $linha['valor'];
$data_abertura = $linha['data_abertura'];
$cod = $linha['cod'];
?>
<tr class="selectable">
<td class="center"><?echo $cod?></span></td>
<td class="center"><?echo $data_abertura?></td>
<td class="center"><?echo $p_tipo_veiculo?></td>
<td class="center"><input type="text" name="qtd" /></td>
<td class="text-center">
<font size="3.5"> <input type="text" value="<?echo $valor?>" />
</td>
<td class="text-center">
<input type="text" name="total" value="resultado" />
</td>
</tr>
<?}?>
</tbody></table>
Perfect was just what I needed, plus I have a little problem. is that I have to put the name="value" with [] would look like this name="value[]" name="Qtd[]" name="total[]" more ai, stop making the caulcule how can I hit this?
– Fabio Henrique
@Fabiohenrique in this case just add
[]
in the strings of the code -> http://jsfiddle.net/mxjfLu1x/1/– Sergio
I had done it but it hadn’t worked.... Now ta working perfectly. Blz
– Fabio Henrique
Partner... You would know how to tell me how to make total appear formatted example 0.00,00 -
– Fabio Henrique
@Fabiohenrique take a look here: http://answall.com/q/11018/129
– Sergio