gostaria de saber se é possível executar um calculo em real time com jquery dentro de um foreach do php e como? esse é meu codigo:
<?php
$Read = new Read;
$Read->ExeRead("c100web", "WHERE codclient = :client", "client={$Clie}");
if (!$Read->getResult()):
VARErro("Não á registros na lista, cadastre os produtos!", INFOR);
else:
foreach ($Read->getResult() as $Pedidos):
extract($Pedidos);
$Style = "";
$ReadProd = new Read;
$ReadProd->ExeRead("c007prod", "WHERE codigo = :cod", "cod={$codpro}");
if ($ReadProd->getResult()):
$Nome = $ReadProd->getResult()[0]['descricao'];
$PrecoUni = $ReadProd->getResult()[0]['preco_venda'];
endif;
?>
<tr>
<td><?= $Nome; ?></td>
<td><input disabled="" type="text" name="vlruni" id="vlruni" value="<?= $PrecoUni; ?>"/></td>
<td><input type="number" name="qnt[]" id="qnt" value="<?= $qntpro; ?>"/></td>
<td><input disabled="" type="text" name="vlrtl" id="vlrtl"/></td>
</tr>
<tr><td colspan="4" style="padding: 4px; background-color: #ccc;"></td></tr>
<?php
endforeach;
?>
<tr>
<td colspan="3">Valor total do pedido:</td>
<td><input disabled="" type="text" name="vlrlist" id="vlrlist"/></td>
</tr>
<?php
endif;
?>
é basicamente assim: vlruni * qnt = vlrtl e vlrtl + vlrtl + vlrtl.... = vlrlist, é possivel?... obrigado!
HTML:
<tr>
<td>ACUCAR MASCAVO FAVINHO 500G</td>
<td><input disabled="" type="text" name="vlruni" id="vlruni" value="4.6"/></td>
<td><input type="number" name="qnt[]" id="qnt" value="12"/></td>
<td><input disabled="" type="text" name="vlrtl" id="vlrtl"/></td>
</tr>
<tr><td colspan="4" style="padding: 4px; background-color: #ccc;"></td></tr>
<tr>
<td>ACUCAR MASCAVO FAVINHO 1K</td>
<td><input disabled="" type="text" name="vlruni" id="vlruni" value="7.7"/></td>
<td><input type="number" name="qnt[]" id="qnt" value="10"/></td>
<td><input disabled="" type="text" name="vlrtl" id="vlrtl"/></td>
</tr>
<tr><td colspan="4" style="padding: 4px; background-color: #ccc;"></td></tr>
<tr>
<td>AMENDOIM AMENDUPÃ C/ CASCA 280G</td>
<td><input disabled="" type="text" name="vlruni" id="vlruni" value="2.7"/></td>
<td><input type="number" name="qnt[]" id="qnt" value="5"/></td>
<td><input disabled="" type="text" name="vlrtl" id="vlrtl"/></td>
</tr>
<tr><td colspan="4" style="padding: 4px; background-color: #ccc;"></td></tr>