0
Good morning,
I got the following:
<div class="form-group col-md-2">
<label for="campo4">Valor da Peça</label>
<input type="text" class="form-control" name="customer['valor_venda']">
</div>
. . Value of the Piece . . Value of the Piece . . Among other inputs, but these I need to add to insert in a field, in which I tried
<div class="form-group col-md-2">
<label for="campo6">Valor Total da Venda</label>
<input ('%.2n', $customer['valor_venda']+$customer['valor_venda2']+$customer['valor_venda3']+$customer['valor_venda4']+$customer['valor_venda5'] . "\n") class="form-control" name="customer['total']" >
</div>
I’ve tried many ways, including, dumb, like this:
<div class="form-group col-md-2">
<label for="campo6">Valor Total da Venda</label>
<input type="text" class="form-control" name="customer['total']" value="<?php echo money_format ('%.2n', $customer['valor_venda']+$customer['valor_venda2']+$customer['valor_venda3']+$customer['valor_venda4']+$customer['valor_venda5'] . "\n"); ?>">
</div>
I am unable to write the 'total' value in the BD (Mysql) and I am without ideas what to do.
Some light, if you please !!
Milestones do you want, when filling in the input value, the calculation to be done automatically, this? Or are you searching from PHP the values just want to add them and display in input?
– Thiago Santos
and why a
. "\n"
at the end of the sum?– Thiago Santos
Yes, that the calculation is done automatically and I can write to the BD’s'total'. With respect to . "| "as I commented: "even, stupidly..." rsrsrs
– Marcos Moraes