Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/05/2010, 11:24
iggy1995
 
Fecha de Ingreso: junio-2009
Mensajes: 14
Antigüedad: 14 años, 10 meses
Puntos: 0
Sumar % al total

Hola buenas tengo este codigo:
Código PHP:
<script
function 
calcular(campo) { 
 
frm=campo.form
 var 
prod=0
 var 
y=0
 while (
typeof frm.elements["c"+y]!="undefined") { 
 var 
o=frm.elements["c"+y]; 
 var 
x=0;
 while (!
o[x].checked) { x++; } 
 
prod+=parseFloat(o[x].value); 
 
y++; 
 } 
 
document.getElementById("resultado").text

  
</script>
<input name="c0" type="radio" onclick="calcular(this)" value="1000" />
<input value="1050" type="radio" name="c0" onclick="calcular(this)" />
<table width="84" border="0">
                  <tr>
                    <td width="52"><table width="54">
                        <tr>
                          <td width="34">Total: </td>
                          <td width="10" id="resultado">0</td>
                        </tr>
                    </table></td>
                    <td width="101">&euro; </td>
                  </tr>
                </table> 
Me podrian ayudar a conseguir que el total de la suma se le añada un tanto por ciento y calcule un total final

Ejemplo:

Subtotal +
16 %
-----------
Total


Gracias

Última edición por iggy1995; 01/05/2010 a las 11:31