Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) como faço para aparecer o R$


arldin

Pergunta

Ola amigos gostaria de saber como posso fazer que o "R$" seja exibido no meu total

pois coloque uma funão mias ela so adciona o "R$" no total geral nos outro ela não exibi, se eu colocar para exibir nos outros ai não me da o resultado no total gera

Por favo me de uma luz o escript e este abaixo junto com a pagina


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Formulario de Pedido</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<script language=javascript>

var nItens = 39;

function recalculaTotais (frm)
{
var total = 0;
for (var i = 0; i < nItens; i++)
{
frm.total[i].value = Math.round(frm.preço[i].value * frm.quant[i].value * 100+"."+"00") / 100+"."+"00";
total += parseFloat(frm.total[i].value);
}
frm.totalgeral.value = forma(total);
}
function forma(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num)) num = "0";
cents = Math.floor((num*100+0.5)%100);
num = Math.floor((num*100+0.5)/100).toString();
if(cents < 10) cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));
return ("R$ " + num + "." + cents);
}
</SCRIPT>

<META content="MSHTML 6.00.2900.3354" name=GENERATOR>
<FORM id=formEmail name=formEmail action=envia1.asp method=post></HEAD>
<BODY background=Arldinartfest5/index_arquivos/image306.gif>
<H1 TYPE="Hidden">Formulario de Pedido<FONT color=#0000ff
size=1></TD>&nbsp;<INPUT id=emaild type=hidden value=arldin@arldinartfest.com.br
name=emaild></FONT><TD width="150"></TD></TR><FONT size=1><FONT color=#0000ff>
</FONT></FONT></H1><FORM name="f">
<TABLE style="WIDTH: 599px; HEIGHT: 315px">
<TBODY>
<TR>
<TH>Imagen
<TH>Códico
<TH>Produto
<TH>Preço
<TH>Quantidade
<TH>Total
<TR>
<TD><IMG style="WIDTH: 40px; HEIGHT: 31px" height=35 alt=""
src="Arldin/baixados1/001.JPG" width=47>
<TD>Cód.001
<TD TYPE="Hidden" READONLY="0">Homem Aranha
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[0].focus() type=hidden size=6 value=10.00
name=preco1>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant1>
<TD><INPUT id=total onfocus=this.form.quant[1].focus() size=8 value=R$0.00
name=total1>
<TR>
<TD><IMG style="WIDTH: 41px; HEIGHT: 33px" height=31 alt="" hspace=0
src="Arldin/baixados1/002.JPG" width=40 border=0>
<TD>Cód.002
<TD READONLY="1" SIZE="8" VALUE="10.00">Flamengo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[1].focus() type=hidden size=6 value=10.00
name=preco2>
<TD SIZE="8" VALUE="R$0.00"><INPUT id=quant
onchange=recalculaTotais(this.form) size=4 name=quant2>
<TD><INPUT id=total onfocus=this.form.quant[2].focus() size=8 value=R$0.00
name=total2>
<TR>
<TD><IMG style="WIDTH: 37px; HEIGHT: 36px" height=31 alt="" hspace=0
src="Arldin/baixados1/003.jpg" width=40 border=0>
<TD>Cód.003
<TD>Vasco
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[2].focus() type=hidden size=6 value=10.00
name=preco3>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant3>
<TD><INPUT id=total onfocus=this.form.quant[3].focus() size=8 value=R$0.00
name=total3>
<TR>
<TD><IMG style="WIDTH: 35px; HEIGHT: 36px" height=31 alt="" hspace=0
src="Arldin/baixados1/004.jpg" width=40 border=0>
<TD>Cód.004
<TD>Botafogo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[3].focus() type=hidden size=6 value=10.00
name=preco4>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant4>
<TD><INPUT id=total onfocus=this.form.quant[4].focus() size=8 value=R$0.00
name=total4>
<TR>
<TD><IMG style="WIDTH: 40px; HEIGHT: 39px" height=31 alt="" hspace=0
src="Arldin/baixados1/005.jpg" width=40 border=0>
<TD>Cód.005
<TD>Fluminense
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[4].focus() type=hidden size=6 value=10.00
name=preco5>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant5>
<TD><INPUT id=total onfocus=this.form.quant[5].focus() size=8 value=R$0.00
name=total5>
<TR>
<TD><IMG height=44 alt="" src="Arldin/baixados1/006.jpg" width=36>
<TD>Cód.006
<TD>Corintians
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[5].focus() type=hidden size=6 value=10.00
name=preco6>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant6>
<TD><INPUT id=total onfocus=this.form.quant[6].focus() size=8 value=R$0.00
name=total6>
<TR>
<TD><IMG height=40 alt="" src="Arldin/baixados1/007.jpg" width=39>
<TD>Cód.007
<TD>São Paulo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[6].focus() type=hidden size=6 value=10.00
name=preco7>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant7>
<TD><INPUT id=total onfocus=this.form.quant[7].focus() size=8 value=R$0.00
name=total7>
<TR>
<TD><IMG height=46 alt="" src="Arldin/baixados1/008.jpg" width=42>
<TD>Cód.008
<TD>Santos
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[7].focus() type=hidden size=6 value=10.00
name=preco8>
<TD SIZE="4"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant8>
<TD><INPUT id=total onfocus=this.form.quant[8].focus() size=8 value=R$0.00
name=total8>
<TR>
<TD><IMG height=46 alt="" src="Arldin/baixados1/009.jpg" width=41>
<TD>Cód.009
<TD>Palmeiras
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[8].focus() type=hidden size=6 value=10.00
name=preco9>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant9>
<TD><INPUT id=total onfocus=this.form.quant[9].focus() size=8 value=R$0.00
name=total9>
<TR>
<TD><IMG style="WIDTH: 50px; HEIGHT: 37px" height=46 alt=""
src="Arldin/baixados1/010.jpg" width=50>
<TD>Cód.010
<TD>Atlético MG
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[9].focus() type=hidden size=6 value=10.00
name=preco10>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant10>
<TD><INPUT id=total onfocus=this.form.quant[10].focus() size=8
value=R$0.00 name=total10>
<TR>
<TD><IMG height=41 alt="" src="Arldin/baixados1/011.jpg" width=45>
<TD>Cód.011
<TD>Cruzeiro
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[10].focus() type=hidden size=6 value=10.00
name=preco11>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant11>
<TD><INPUT id=total onfocus=this.form.quant[11].focus() size=8
value=R$0.00 name=total11>
<TR>
<TD><IMG height=46 alt="" src="Arldin/baixados1/012.jpg" width=47>
<TD>Cód.012
<TD>Atlético PR
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[11].focus() type=hidden size=6 value=10.00
name=preco12>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant12>
<TD><INPUT id=total onfocus=this.form.quant[12].focus() size=8
value=R$0.00 name=total12>
<TR>
<TD><IMG height=47 alt="" src="Arldin/baixados1/013.jpg" width=46>
<TD>Cód.013
<TD>Coritiba
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[12].focus() type=hidden size=6 value=10.00
name=preco13>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant13>
<TD><INPUT id=total onfocus=this.form.quant[13].focus() size=8
value=R$0.00 name=total13>
<TR>
<TD><IMG height=44 alt="" src="Arldin/baixados1/014.jpg" width=35>
<TD>Cód.014
<TD>Paraná
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[13].focus() type=hidden size=6 value=10.00
name=preco14>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant14>
<TD><INPUT id=total onfocus=this.form.quant[14].focus() size=8
value=R$0.00 name=total14>
<TR>
<TD><IMG height=37 alt="" src="Arldin/baixados1/015.jpg" width=41>
<TD>Cód.015
<TD>Internacional
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[14].focus() type=hidden size=6 value=10.00
name=preco15>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant15>
<TD><INPUT id=total onfocus=this.form.quant[15].focus() size=8
value=R$0.00 name=total15>
<TR>
<TD><IMG height=37 alt="" src="Arldin/baixados1/016.jpg" width=44>
<TD>Cód.016
<TD>Grêmio
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[15].focus() type=hidden size=6 value=10.00
name=preco16>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant16>
<TD><INPUT id=total onfocus=this.form.quant[16].focus() size=8
value=R$0.00 name=total16>
<TR>
<TD><IMG height=48 alt="" src="Arldin/baixados1/017.jpg" width=42>
<TD>Cód.017
<TD>Sel. Brasileira
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[16].focus() type=hidden size=6 value=10.00
name=preco17>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant17>
<TD><INPUT id=total onfocus=this.form.quant[17].focus() size=8
value=R$0.00 name=total17>
<TR>
<TD><IMG height=44 alt="" src="Arldin/baixados1/018.jpg" width=63>
<TD>Cód.018
<TD>Baby Disney
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[17].focus() type=hidden size=6 value=10.00
name=preco18>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant18>
<TD><INPUT id=total onfocus=this.form.quant[18].focus() size=8
value=R$0.00 name=total18>
<TR>
<TD><IMG height=38 alt="" src="Arldin/baixados1/019.JPG" width=52>
<TD>Cód.019
<TD>Branca de Neve
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[18].focus() type=hidden size=6 value=10.00
name=preco19>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant19>
<TD><INPUT id=total onfocus=this.form.quant[19].focus() size=8
value=R$0.00 name=total19>
<TR>
<TD><IMG height=52 alt="" src="Arldin/baixados1/020.JPG" width=50>
<TD>Cód.020
<TD>Cinderela
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[19].focus() type=hidden size=6 value=10.00
name=preco20>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant20>
<TD><INPUT id=total onfocus=this.form.quant[20].focus() size=8
value=R$0.00 name=total20>
<TR>
<TD><IMG height=43 alt="" src="Arldin/baixados1/021.JPG" width=75>
<TD>Cód.021
<TD>Turma da Mônica
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[20].focus() type=hidden size=6 value=10.00
name=preco21>
<TD SIZE="4"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant21>
<TD><INPUT id=total onfocus=this.form.quant[21].focus() size=8
value=R$0.00 name=total21>
<TR>
<TD><IMG height=51 alt="" src="Arldin/baixados1/022.JPG" width=49>
<TD>Cód.022
<TD>Palhaço
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[21].focus() type=hidden size=6 value=10.00
name=preco22>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant22>
<TD><INPUT id=total onfocus=this.form.quant[22].focus() size=8
value=R$0.00 name=total22>
<TR>
<TD><IMG height=54 alt="" src="Arldin/baixados1/023.JPG" width=50>
<TD>Cód.023
<TD>Batmam
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[22].focus() type=hidden size=6 value=10.00
name=preco23>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant23>
<TD><INPUT id=total onfocus=this.form.quant[23].focus() size=8
value=R$0.00 name=total23>
<TR>
<TD><IMG height=56 alt="" src="Arldin/baixados1/024.jpg" width=52>
<TD>Cód.024
<TD>Baby Looney Tuber
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[23].focus() type=hidden size=6 value=10.00
name=preco24>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant24>
<TD><INPUT id=total onfocus=this.form.quant[24].focus() size=8
value=R$0.00 name=total24>
<TR>
<TD><IMG style="WIDTH: 46px; HEIGHT: 38px" height=31 alt="" hspace=0
src="Arldin/baixados1/025.JPG" width=40 border=0>
<TD>Cód.025
<TD>Sherek
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[24].focus() type=hidden size=6 value=10.00
name=preco25>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant25>
<TD><INPUT id=total onfocus=this.form.quant[25].focus() size=8
value=R$0.00 name=total25>
<TR>
<TD><IMG height=39 alt="" src="Arldin/baixados1/026.jpg" width=48>
<TD>Cód.026
<TD VALUE="R$0.00">Nemo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[25].focus() type=hidden size=6 value=10.00
name=preco26>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant26>
<TD><INPUT id=total onfocus=this.form.quant[26].focus() size=8
value=R$0.00 name=total26>
<TR>
<TD><IMG height=55 alt="" src="Arldin/baixados1/027.jpg" width=44>
<TD>Cód.027
<TD>Barbie
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[26].focus() type=hidden size=6 value=10.00
name=preco27>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant27>
<TD><INPUT id=total onfocus=this.form.quant[27].focus() size=8
value=R$0.00 name=total27>
<TR>
<TD><IMG style="WIDTH: 41px; HEIGHT: 54px" height=62 alt=""
src="Arldin/baixados1/028.JPG" width=42>
<TD>Cód.028
<TD>Pica Pau
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[27].focus() type=hidden size=6 value=10.00
name=preco28>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant28>
<TD><INPUT id=total onfocus=this.form.quant[28].focus() size=8
value=R$0.00 name=total28>
<TR>
<TD><IMG style="WIDTH: 56px; HEIGHT: 45px" height=47 alt=""
src="Arldin/baixados1/029.jpg" width=62>
<TD>Cód.029
<TD>Os Incriveis
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[28].focus() type=hidden size=6 value=10.00
name=preco29>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant29>
<TD><INPUT id=total onfocus=this.form.quant[29].focus() size=8
value=R$0.00 name=total29>
<TR>
<TD><IMG style="WIDTH: 54px; HEIGHT: 40px" height=42 alt=""
src="Arldin/baixados1/030.jpg" width=63>
<TD>Cód.030
<TD>Fámilia Dinossauro
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[29].focus() type=hidden size=6 value=10.00
name=preco30>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant30>
<TD><INPUT id=total onfocus=this.form.quant[30].focus() size=8
value=R$0.00 name=total30>
<TR>
<TD><IMG style="WIDTH: 52px; HEIGHT: 38px" height=40 alt=""
src="Arldin/baixados1/031.JPG" width=59>
<TD>Cód.031
<TD>Ursinhos Carinhosos
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[30].focus() type=hidden size=6 value=10.00
name=preco31>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant31>
<TD><INPUT id=total onfocus=this.form.quant[31].focus() size=8
value=R$0.00 name=total31>
<TR>
<TD><IMG style="WIDTH: 58px; HEIGHT: 47px" height=50 alt=""
src="Arldin/baixados1/032.JPG" width=69>
<TD>Cód.032
<TD>Ursinho Pulf
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[31].focus() type=hidden size=6 value=10.00
name=preco32>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant32>
<TD><INPUT id=total onfocus=this.form.quant[32].focus() size=8
value=R$0.00 name=total32>
<TR>
<TD><IMG style="WIDTH: 46px; HEIGHT: 54px" height=62 alt=""
src="Arldin/baixados1/033.jpg" width=51>
<TD>Cód.033
<TD>Jovens Titãs
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[32].focus() type=hidden size=6 value=10.00
name=preco33>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant33>
<TD><INPUT id=total onfocus=this.form.quant[33].focus() size=8
value=R$0.00 name=total33>
<TR>
<TD><IMG height=38 alt="" src="Arldin/baixados1/034.JPG" width=70>
<TD>Cód.034
<TD>Rei Leão
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[33].focus() type=hidden size=6 value=10.00
name=preco34>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant34>
<TD><INPUT id=total onfocus=this.form.quant[34].focus() size=8
value=R$0.00 name=total34>
<TR>
<TD><IMG height=35 alt="" src="Arldin/baixados1/035.JPG" width=57>
<TD>Cód.035
<TD>Hello Kity
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[34].focus() type=hidden size=6 value=10.00
name=preco35>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant35>
<TD><INPUT id=total onfocus=this.form.quant[35].focus() size=8
value=R$0.00 name=total35>
<TR>
<TD><IMG style="WIDTH: 56px; HEIGHT: 33px" height=37 alt=""
src="Arldin/baixados1/036.JPG" width=61>
<TD>Cód.036
<TD>Os Dálmatas
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[35].focus() type=hidden size=6 value=10.00
name=preco36>
<TD SIZE="8" VALUE="R$0.00"><INPUT id=quant
onchange=recalculaTotais(this.form) size=4 name=quant36>
<TD><INPUT id=total onfocus=this.form.quant[36].focus() size=8
value=R$0.00 name=total36>
<TR>
<TD><IMG style="WIDTH: 47px; HEIGHT: 43px" height=46 alt=""
src="Arldin/baixados1/037.JPG" width=53>
<TD>Cód.037
<TD>Moranguinho
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[36].focus() type=hidden size=6 value=10.00
name=preco37>
<TD SIZE="8" VALUE="R$0.00"><INPUT id=quant
onchange=recalculaTotais(this.form) size=4 name=quant37>
<TD><INPUT id=total onfocus=this.form.quant[37].focus() size=8
value=R$0.00 name=total37>
<TR>
<TD><IMG style="WIDTH: 48px; HEIGHT: 46px" height=53 alt=""
src="Arldin/baixados1/038.jpg" width=51>
<TD>Cód.038
<TD>X-Mem
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[37].focus() type=hidden size=6 value=10.00
name=preco38>
<TD SIZE="8" VALUE="R$0.00"><INPUT id=quant
onchange=recalculaTotais(this.form) size=4 name=quant38>
<TD><INPUT id=total onfocus=this.form.quant[38].focus() size=8
value=R$0.00 name=total38>
<TR>
<TD><IMG style="WIDTH: 42px; HEIGHT: 49px" height=52 alt=""
src="Arldin/baixados1/039.JPG" width=44>
<TD>Cód.039
<TD>O Mascara
<TD VALUE="R$0.00">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[38].focus() type=hidden size=6 value=10.00
name=preco39>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant39>
<TD><INPUT id=total onfocus=this.form.nome.focus() size=8 value=R$0.00
name=total39>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD><STRONG>Total :</STRONG> </TD>
<TD><INPUT id=totalgeral onfocus=this.form.bot.focus() size=8 value=R$0.00
name=totalgeral></TD></TR></TBODY></TABLE>
<P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD>
<P>Nome do Comprador:<INPUT id=nome style="WIDTH: 384px; HEIGHT: 22px"
size=49 name=nome></P>
<P>Endereço:<INPUT id=end style="WIDTH: 356px; HEIGHT: 22px" size=45
name=end>&nbsp;&nbsp;Numero:<INPUT id=num
style="WIDTH: 102px; HEIGHT: 22px" size=12 name=num></P>
<P>Cidade:<INPUT id=cid style="WIDTH: 245px; HEIGHT: 22px" size=31
name=cid>&nbsp;Estado:<SELECT size=1 name=estado> <OPTION value=""
selected></OPTION> <OPTION value=AC>AC</OPTION> <OPTION
value=AL>AL</OPTION> <OPTION value=AM>AM</OPTION> <OPTION
value=AP>AP</OPTION> <OPTION value=BA>BA</OPTION> <OPTION
value=CE>CE</OPTION> <OPTION value=DF>DF</OPTION> <OPTION
value=ES>ES</OPTION> <OPTION value=GO>GO</OPTION> <OPTION
value=MA>MA</OPTION> <OPTION value=MG>MG</OPTION> <OPTION
value=MS>MS</OPTION> <OPTION value=muito>muito</OPTION> <OPTION
value=PA>PA</OPTION> <OPTION value=PB>PB</OPTION> <OPTION
value=PE>PE</OPTION> <OPTION value=PI>PI</OPTION> <OPTION
value=PR>PR</OPTION> <OPTION value=RJ>RJ</OPTION> <OPTION
value=RN>RN</OPTION> <OPTION value=RO>RO</OPTION> <OPTION
value=RR>RR</OPTION> <OPTION value=RS>RS</OPTION> <OPTION
value=SC>SC</OPTION> <OPTION value=SE>SE</OPTION> <OPTION
value=SP>SP</OPTION> <OPTION value=TO>TO</OPTION></SELECT>&nbsp;Cep:<INPUT
id=cep name=cep></P>
<P>DDD:<INPUT id=ddd style="WIDTH: 72px; HEIGHT: 22px" size=9
name=ddd>&nbsp;Telefone:<INPUT id=tel style="WIDTH: 137px; HEIGHT: 22px"
size=17 name=tel>&nbsp; Fax:<INPUT id=fax name=fax></P>
<P>Email de resposta: <INPUT id=responder
style="WIDTH: 278px; HEIGHT: 22px" size=33 name=responder></P>
<P>Formas de pagamendo<SELECT style="WIDTH: 149px" size=1 name=pag>
<OPTION value="" selected></OPTION> <OPTION
value="Boleto bancario">Boleto bancario</OPTION> <OPTION
value="Cheque pre">Cheque pre</OPTION> <OPTION
value=Deposit>Deposito</OPTION> <OPTION value="A vista">A
vista</OPTION></SELECT>Cheque num:<INPUT id=numch
style="WIDTH: 152px; HEIGHT: 22px" size=19 name=numch></P>
<P>Banco Num:<INPUT id=bcnum style="WIDTH: 93px; HEIGHT: 22px" size=12
name=bcnum>&nbsp;C/c:<INPUT id=cc name=cc>Bom para:<INPUT id=dta
style="WIDTH: 117px; HEIGHT: 22px" size=13 name=dta></P>
<P>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=1>
<TBODY>
<TR>
<TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Coloque outros temas que não tem no formulario</TD></TR>
<TR>
<TD>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<TEXTAREA style="WIDTH: 229px; HEIGHT: 126px" name=mensagem rows=7 cols=25></TEXTAREA></TD></TR></TBODY></TABLE></P></TD></TR></TBODY></TABLE></P>
<P><INPUT type=submit value=Envia name=bot> </P>
<P></FORM></P></BODY></HTML>[/codebox]

Desde já eu agradeço

Link para o comentário
Compartilhar em outros sites

10 respostass a esta questão

Posts Recomendados

  • 0

arldin, por favor, use o português. Ter que decifrar códigos e o português é embaçado.

O código está enorme para o que ele precisa fazer, cuidado com isso.

Usou 500 linhas pra fazer algo que em menos de 100 dá pra fazer.

Não entendi mesmo o que você quer, eu sugiro que coloque os R$ no html sem misturar com javascript. Coloque na frente dos campos os "R$".

Deixa que o javascript cuide apenas da forma numérica.

Mas não entendi patavinas, então por favor explique melhor. Não dá pra eu ficar testando seu código inteiro e preenchendo os campos do seu formulário, odeio fazer isso. Se possível, poste claramente o seu problema.

Aquele abraço.

Link para o comentário
Compartilhar em outros sites

  • 0
Guest Visitante

Arldin

o que eu estou precisando e o sequinte quando escolherem a quantidade do prodto aparesa no total o valor com o R$, por exemplo, se eu escolher 5 qted do produto "Homem Aranha" que e o primeiro da lista no total, aparece 50.00 e total geral aparece R$50.00, então o que eu quero e que do mesmo jeito que aparece no total geral apareça no total individual.

Obrigado

Link para o comentário
Compartilhar em outros sites

  • 0

Amigos estou com um pequeno poblema tenhos este formulario de calculo, e esta dando o sequinte erro

Quando eu escolho a qtd ele retona no valor certo mais no total geral ele me da a sequinte mensagem

"R$NaN.NaN"

Ele não esta me dando o valor total alquem pode me amostra a onde estou erando por favor

seque o script e o html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Formulario de Pedido</TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<script language=javascript>

var nItens = 5;

function recalculaTotais (frm)
{
var total = 0;
for (var i = 0; i < nItens; i++)
{
frm.total[i].value =forma(Math.round(frm.preço[i].value * frm.quant[i].value * 0.1)/0.1)
total = forma(Math.floor(frm.total[i].value*0.1)/0.1);
}
frm.totalgeral.value = forma(total)
}
function forma(num){
reais=Math.floor(num)
cents=Math.round((num-reais)*100)
texto="R$"+reais+"."
if(cents<10){
texto=texto+"0"
}
texto=texto+cents
return texto
}
//-->
</SCRIPT>

<META content="MSHTML 6.00.2900.3354" name=GENERATOR>
<FORM id=formEmail name=formEmail action=envia1.asp method=post></HEAD>
<BODY background=Arldinartfest5/index_arquivos/image306.gif>
<H1 TYPE="Hidden">Formulario de Pedido<FONT color=#0000ff
size=1></TD>&nbsp;</FONT><TD width="150"></TD></TR><FONT size=1><FONT
color=#0000ff> </FONT></FONT></H1><FORM name="f">
<TABLE style="WIDTH: 599px; HEIGHT: 315px">
<TBODY>
<TR>
<TH>Imagen
<TH>Códico
<TH>Produto
<TH>Preço
<TH>Quantidade
<TH>Total
<TR>
<TD><IMG style="WIDTH: 40px; HEIGHT: 31px" height=35 alt=""
src="Arldin/baixados1/001.JPG" width=47>
<TD>Cód.001
<TD TYPE="Hidden" READONLY="0">Homem Aranha
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[0].focus() type=hidden size=6 value=10.00
name=preco1>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant1>
<TD><INPUT id=total onfocus=this.form.quant[1].focus() size=8 value=R$0.00
name=total1>
<TR>
<TD><IMG style="WIDTH: 41px; HEIGHT: 33px" height=31 alt="" hspace=0
src="Arldin/baixados1/002.JPG" width=40 border=0>
<TD>Cód.002
<TD READONLY="1" SIZE="8" VALUE="10.00">Flamengo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[1].focus() type=hidden size=6 value=10.00
name=preco2>
<TD SIZE="8" VALUE="R$0.00"><INPUT id=quant
onchange=recalculaTotais(this.form) size=4 name=quant2>
<TD><INPUT id=total onfocus=this.form.quant[2].focus() size=8 value=R$0.00
name=total2>
<TR>
<TD><IMG style="WIDTH: 37px; HEIGHT: 36px" height=31 alt="" hspace=0
src="Arldin/baixados1/003.jpg" width=40 border=0>
<TD>Cód.003
<TD>Vasco
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[2].focus() type=hidden size=6 value=10.00
name=preco3>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant3>
<TD><INPUT id=total onfocus=this.form.quant[3].focus() size=8 value=R$0.00
name=total3>
<TR>
<TD><IMG style="WIDTH: 35px; HEIGHT: 36px" height=31 alt="" hspace=0
src="Arldin/baixados1/004.jpg" width=40 border=0>
<TD>Cód.004
<TD>Botafogo
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[3].focus() type=hidden size=6 value=10.00
name=preco4>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant4>
<TD><INPUT id=total onfocus=this.form.quant[4].focus() size=8 value=R$0.00
name=total4>
<TR>
<TD><IMG style="WIDTH: 40px; HEIGHT: 39px" height=31 alt="" hspace=0
src="Arldin/baixados1/005.jpg" width=40 border=0>
<TD>Cód.005
<TD>Fluminense
<TD TYPE="Hidden">R$ 10,00<INPUT id=preço
onfocus=this.form.quant[4].focus() type=hidden size=6 value=10.00
name=preco5>
<TD SIZE="8"><INPUT id=quant onchange=recalculaTotais(this.form) size=4
name=quant5>
<TD><INPUT id=total onfocus=this.form.quant[5].focus() size=8 value=R$0.00
name=total5>
<TR>
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD><STRONG>Total :</STRONG> </TD>
<TD><INPUT id=totalgeral onfocus=this.form.bot.focus() size=8 value=R$0.00
name=totalgeral></TD></TR></TBODY></TABLE>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P></FORM></P></BODY></HTML>[/codebox]

Desde já agradeço a colaboração

Editado por fercosmig
Adicionar tag's
Link para o comentário
Compartilhar em outros sites

  • 0

Amigo neste script ele já me da o R$ no total geral o que eu estou querendo e que o R$ apareça nos totais individual, por exemplo

Eu escolhoo o produto Homem Aranha seleciono a qtd e o total me da o sequinte 50.00 o que eu estou querendo e que o R$ apareça junto

Atenciosamnete

arldin

Link para o comentário
Compartilhar em outros sites

  • 0

Estou passando o script que um do nosso amigo "OTTA" me ajudou, para outros que queiram ussar

<script language=javascript>

var nItens = 5;

function recalculaTotais(frm)
{
var total = 0;
for (var i = 0; i < nItens; i++)
{
frm.total[i].value = forma(Math.round(frm.preço[i].value * frm.quant[i].value * 0.1)/0.1)
total+= parseFloat(frm.total[i].value.replace("R$",""));
}
frm.totalgeral.value = forma(total)

}
function forma(num){

reais = Math.floor(num);
cents = Math.round((num-reais)*100);
texto = "R$" + reais + ".";
if(cents < 10){
texto = texto + "0";
}
texto = texto + cents;

return texto;
}
//-->
</SCRIPT>

Muito Obrigao mesmo :D

Editado por fercosmig
Adicionar tag's
Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...