Jump to content


Vitor Gomes

Member Since 25/09/2004
Offline Last Active 26/03/2006, 18:01
-----

Posts I've Made

In Topic: Fácil?

26/03/2006, 18:04

Consegui fazer algumas coisas, mas restou o principal: SOMAR OS RADIOS SELECIONADOS. Só consigo mostrar o valor correspondente de cada rádio. Será que alguém poderia me ajudar com essa função. Não deve ser díficil... ou é??? Por favor me ajudem. Quero muito apredner.

<html>
<head>
  <title>Venda de Computadores</title>
  <script language="JavaScript">


function checkChoice(whichbox) {
with (whichbox.form) {
if (whichbox.checked == false)
hiddentotal.value = eval(hiddentotal.value) - eval(whichbox.value);
else
hiddentotal.value = eval(whichbox.value)
return(hiddentotal.value);
}
}

  </script>
  <style type="text/css">
<!--
.style1 {
font-size: 22px;
font-weight: bold;
}

-->
  </style>
</head>
<body>
<form name="enviar_formulario" onsubmit="return enviar();">

<b><span style="font-family: Comic Sans MS;"> Dados do Computador </span>
</b>
<p>
<b>Processador:<label><br><input type="radio" name="amd32" onclick="this.form.total.value=checkChoice(this);" value="350">
 AMD Athlon XP 3.2 OEM &nbsp;&nbsp;&nbsp;R$ 350,00</label>
        <br>
        <label>
        <input type="radio" name="amd64" onclick="this.form.total.value=checkChoice(this);" value="435">
        AMD Athlon 64 3.0 OEM&nbsp;&nbsp;&nbsp; 
        R$ 435,00</label>
        <br>
        <label>
        <input type="radio" name="p4" onclick="this.form.total.value=checkChoice(this);" value="520">
        Intel Pentium 4 2.4 &nbsp;&nbsp;&nbsp;
        R$ 520,00</label>
        <br>
<label>
        <input type="radio" name="p4ht" onclick="this.form.total.value=checkChoice(this);" value="835">
 Intel Pentium 4 3.4 HT Prescott &nbsp;&nbsp;&nbsp;R$ 835,00</label>
</p>
<p>Mem&oacute;ria:<label><br><input type="radio" name="256" onclick="this.form.total.value=checkChoice(this);" value="100">
 256 Mb &nbsp;&nbsp;&nbsp;</label>R$ 100,00 
        <br>
        <label>
        <input type="radio" name="512" onclick="this.form.total.value=checkChoice(this);" value="170">
        512
        Mb
</label>&nbsp;&nbsp;&nbsp;R$ 170,00
        <br>
        <label>
        <input type="radio" name="1" onclick="this.form.total.value=checkChoice(this);" value="330">
        1 Gb</label>

&nbsp;&nbsp;&nbsp;R$ 330,00
</p>
<p>HD:
<label><br><input type="radio" name="40" onclick="this.form.total.value=checkChoice(this);" value="180">
 40 Gb
</label>&nbsp;&nbsp;&nbsp;R$ 180,00<br>
<input type="radio" name="80" onclick="this.form.total.value=checkChoice(this);" value="250">
 80 Gb
&nbsp;&nbsp;&nbsp; R$ 250,00
</p>
<p>Monitor:
<br>
 CRT
         <input type="radio" name="15" onclick="this.form.total.value=checkChoice(this);" value="300">
 15 polegadas 
         <input type="radio"  name="17" onclick="this.form.total.value=checkChoice(this);" value="350">
        17 polegadas
&nbsp;&nbsp;&nbsp;R$ 300,00 / 350,00 <br>

 LCD
        <input type="radio" name="15p" onclick="this.form.total.value=checkChoice(this);" value="800"> 
 15 polegadas 
        <input type="radio" name="17p" onclick="this.form.total.value=checkChoice(this);" value="1100"> 
        17 polegada
&nbsp;&nbsp;&nbsp;R$ 800,00 / 1100,00
</p>
<p>Placa de V&iacute;deo: <label><br><input type="radio" name="gf128" onclick="this.form.total.value=checkChoice(this);" value="150">
 GEForce 128 Mb
 </label>&nbsp;&nbsp;&nbsp;R$ 150,00 <br>

<label><input type="radio" name="gf256" id="gf256" onclick="this.form.total.value=checkChoice(this);" value="300">
 GEForce 256 Mb
&nbsp;&nbsp;&nbsp;</label>R$ 300,00<label>
    <br>
<input type="radio" name="ht" id="ht" onclick="this.form.total.value=checkChoice(this);" value="200" > 
 Home Teather (5.1)
 </label>&nbsp;&nbsp;&nbsp;R$ 200,00 <label><br>
   <input type="radio" name="wc" id="wc" onclick="this.form.total.value=checkChoice(this);" value="110" > 
 Web Cam / Microfone / Fone de Ouvido&nbsp;
</label>&nbsp;&nbsp;&nbsp;R$ 110,00
</p>
<p>Gravador:
<label><br><input type="radio" name="cd" onclick="this.form.total.value=checkChoice(this);" value="90">
 CD
 </label>&nbsp;&nbsp;&nbsp;R$ 90,00<label><br>
</label>
 <label><input type="radio" name="dvd" onclick="this.form.total.value=checkChoice(this);" value="160">
 DVD
</label>&nbsp;&nbsp;&nbsp;R$ 160,00&nbsp;<br>
&nbsp;
</p>
<p><strong>Valor Total:</strong>        
      <input readonly="readonly" size="10" name="total"><input
 value="0" name="hiddentotal" type="hidden">
</p>

  <p><input name="Enviar" value="Enviar"
 type="submit">
  <input name="limpar" id="limpar" value="Limpar"
 type="reset"></p>
  </form>
</body>
</html>

In Topic: Dúvida Simples

02/10/2005, 20:51

Eu teu caso, troque isto:

eval(total=total+mat+edre+jog);
Por isto:
total = parseInt(total + mat + edre + jog);
Acredito que funcione. Se não der, poste novamente ... ;)

[]’s :D

Tentei e não consegui.
Pela ajuda do Klaus, eu não faço a minina ideia como é por ser feito. Sou muito noob.
Seria muito pedir a vcs que mudassem meu codigo??? Ficaria muito grato se vcs me ajudassem.
Obrigado

In Topic: Dúvida Simples

02/10/2005, 11:40

Pois é, eu tentei usar essa função parseInt, mas como o formulario tem uns items que deverão ser somados se forem acionados... aew que o meu problema pega. Não seria muito abuso da minha parte, alguém me mandar a linha de código certa pra que essa operção seja efetuada com todos os items incluidos pra sair o valor total? Ficaria muito grato.

Obrigado.

In Topic: Somando Items

26/09/2005, 15:12

Minha dúvida é de saber qual o código para efetuar a soma de valores dos items "tamanho de cama" mais o "material" selecionado.

Já tentei de várias forma. Ultimamente tentando com o getElementById, mas nada...
Soluções ainda nenhuma, já que estou com dificuldades. Continuo parado.
Problemas não há nenhum e sim complemento ao código para tal operção.

Pode judar?
Obrigado!

In Topic: Dúvida Simples

25/09/2005, 17:40

Pow cara vlw mesmo. Brigadão. Tu sabe mesmo. Não sendo muito entrometido, mas sendo, vc poderia quebrar outra pra mim? É nesse código mesmo. Queria que um valor qualquer fosse posto no campo "preço". Por ex: já que o item "material" tem 3 sub items, quando eu escolhesse um sub item qualquer, esse seria dado o valor no campo "preço". Entendeu? E acho que sim né?
OBRIGADO pela ajuda.

Vitor.

IPB Skin By Virteq