Somas em um formulario
Boa tarde,
Estou tentando fazer um formulário com com várias linhas onde tenho que colocar um total na linha e colocar um total do formulário.
<table width="957" border=1 style="background-color: rgb(192, 192, 192); height="25"">
<tbody>
<tr>
<td width="94" style="background-color: rgb(192, 192, 192); font-family: Verdana; text-align: center;">
Quantidade
</td>
<td width="345" style="background-color: rgb(192, 192, 192); font-family: Verdana; text-align: center" height="25">
Evento Financeiro
</td>
<td width="152" style="background-color: rgb(192, 192, 192); font-family: Verdana; text-align: center" height="25">
Vencimento
</td>
<td width="156" style="background-color: rgb(192, 192, 192); font-family: Verdana; text-align: center" height="25">
Valor Unitário
</td>
<td width="176"> <div align="center">Valor total </div></td>
</tr>
</tbody>
</table>
<table width="957" border=1 style="height="25"">
<tbody>
<tr>
<td width="95" style="font-family: Verdana; text-align: center;">
<input name="quant1" type="text_10">
</td>
<td width="346" style="font-family: Verdana; text-align: center" height="25">
<select name="ccodigoeventofinanceiro">
<option>Selecione o evento</option>
<? $sqlevfin = "SELECT * FROM eventosfinanceiro ORDER BY CDESCRICAOEVENTOFINANCEIRO";
$query = mysql_query($sqlevfin);
while($evenfin = mysql_fetch_array($query)) { ?>
<option value="<?echo $evenfin['CCODIGOEVENTOFINANCEIRO'] ?>"><?echo $evenfin['CDESCRICAOEVENTOFINANCEIRO'] ?></option>
<? } ?>
</select>
</td>
<td width="151" style="font-family: Verdana; text-align: center" height="25">
<input name="venc1" type="text_15" id="calendario" />
</td>
<td width="156" style=" font-family: Verdana; text-align: center" height="25">
<input name="vrunit1" type="text_15" onClick="">
</td>
<td width="175">
<div id="total">
</div>
</td>
</tr>
</tbody>
</table>
<table width="957" border=1 style="height="25"">
<tbody>
<tr>
<td width="95" style="font-family: Verdana; text-align: center;">
<input name="quant2" type="text_10">
</td>
<td width="346" style="font-family: Verdana; text-align: center" height="25">
<select name="ccodigoeventofinanceiro">
<option>Selecione o evento</option>
<? $sqlevfin = "SELECT * FROM eventosfinanceiro ORDER BY CDESCRICAOEVENTOFINANCEIRO";
$query = mysql_query($sqlevfin);
while($evenfin = mysql_fetch_array($query)) { ?>
<option value="<?echo $evenfin['CCODIGOEVENTOFINANCEIRO'] ?>"><?echo $evenfin['CDESCRICAOEVENTOFINANCEIRO'] ?></option>
<? } ?>
</select>
</td>
<td width="151" style="font-family: Verdana; text-align: center" height="25">
<input name="venc2" type="text_15" id="calendario" />
</td>
<td width="156" style=" font-family: Verdana; text-align: center" height="25">
<input name="vrunit2" type="text_15" onClick="">
</td>
<td width="175">
<div id="total">
</div>
</td>
</tr>
</tbody>
</table>
essa div id=total seria onde colocaria a soma da linha
e aí teria um total geral das linhas
Grato
Discussão (0)
Carregando comentários...