RESPONDER UNA PREGUNTA

Si para responder la pregunta, crees necesario enviar un archivo adjunto, puedes hacerlo a traves del correo [email protected]

    Pregunta:  68239 - PROBLEMA CON FORMULARIO
Autor:  emeteria suarez
Hola amigos quisiera si puede ser me ayudarais a solucionar el formulario que os he enviado, quiero que el resultado sea algo parecido a lo que pongo en la parte de abajo, muchas gracias de antemano.

<html>
<head>
<title>Mi pagina web</title>
<script>
function calculo(cantidad,precio,inputtext,totaltext){

/* Parametros:
cantidad - entero con la cantidad
precio - entero con el precio
inputtotal - nombre del elemento del formulario donde ira el total
*/

// Calculo del subtotal
subtotal = precio*cantidad;
inputtext.value=subtotal;

//Actualizar el total
// Utilizamos el eval. Ya que el valor es un texto y si lo tratamos como tal
// es como si estuviesemos manipulando una cadena.
total = eval(totaltext.value);
totaltext.value = total + subtotal;
}
</script>
<style type="text/css">
.negrita {
font-weight: bold;
}
</style>
<style type="text/css">

</style>
<body>
<h1>ELIGE TUS PRODUCTOS</h1>
<form action="mailto:[email protected]" method="post" enctype="text/plain">
<table width="500">
<tr>
<td width="197" bgcolor="#D4FFAA"><div align="center"><strong>Productos</strong></div></td>
<td width="72" align="left" bgcolor="#D4FFAA" class="negrita">Cantidad</td>
<td width="66" bgcolor="#D4FFAA" class="negrita">Precio/Ud</td>
<td width="109" bgcolor="#D4FFAA" class="negrita">Total</td>
</tr>
<tr>
<td bgcolor="#D4FFAA"><strong>Camiseta</strong></td>
<td align="left" bgcolor="#D4FFAA"><input type="text" size="2" id="Camiseta" value="0" onChange="calculo(this.value,precioCamiseta.value, totalCamiseta,total);">
uds</td>
<td bgcolor="#D4FFAA"><input type="hidden" id="precioCamiseta" value="42"/>
42 €</td>
<td bgcolor="#D4FFAA"><input type="text" size="8" id="totalCamiseta" value="0">
€</td>
</tr>
<tr>
<td bgcolor="#D4FFAA"><strong>Sudadera</strong></td>
<td align="left" bgcolor="#D4FFAA"><input type="text" size="2" id="Sudadera" value="0" onChange="calculo(this.value,precioSudadera.value, totalSudadera,total);">
uds</td>
<td bgcolor="#D4FFAA"><input type="hidden" id="precioSudadera" value="35"/>
35 €</td>
<td bgcolor="#D4FFAA"><input type="text" size="8" id="totalSudadera" value="0">
€</td>
</tr>
<tr>
<td bgcolor="#D4FFAA"><strong>Pantalon</strong></td>
<td align="left" bgcolor="#D4FFAA"><input type="text" size="2" id="Pantalon" value="0" onChange="calculo(this.value,precioPantalon.value, totalPantalon,total);">
uds</td>
<td bgcolor="#D4FFAA"><input type="hidden" id="precioPantalon" value="23"/>
23 €</td>
<td bgcolor="#D4FFAA"><input type="text" size="8" id="totalPantalon" value="0">
€</td>
</tr>
<tr>
<td bgcolor="#D4FFAA"><strong>Calzado</strong></td>
<td align="left" bgcolor="#D4FFAA"><input type="text" size="2" id="Calzado" value="0" onChange="calculo(this.value,precioCalzado.value,totalCalzado,total);">
uds</td>
<td bgcolor="#D4FFAA"><input type="hidden" id="precioCalzado" value="27"/>
27 €</td>
<td bgcolor="#D4FFAA"><input type="text" size="8" id="totalCalzado" value="0">
€</td>
</tr>
<tr>
<td bgcolor="#D4FFAA"><strong> Calcetines </strong></td>
<td align="left" bgcolor="#D4FFAA"><input type="text" size="2" id="Calcetines" value="0" onChange="calculo (this.value,precioCalcetines.value,totalCalcetines,total);">
uds</td>
<td bgcolor="#D4FFAA"><input type="hidden" id="precioCalcetines" value="12"/>
12 €</td>
<td bgcolor="#D4FFAA"><input type="text" size="8" id="totalCalcetines" value="0">
€</td>
</tr>
<td height="81" bgcolor="#D4FFAA"><strong>Total: </strong></td>
<td align="left" bgcolor="#D4FFAA"></td>
<td bgcolor="#D4FFAA"></td>
<td bgcolor="#D4FFAA"><p><br/>
<input type="text" id="total"size="10"
value="0">
€</p>
<p>*</p></td>
</tr>
</table>
<input name="Enviar" type="submit" id="Enviar" value="Enviar información">
<input name="Borrar" type="reset" id="Borrar" value="Borrar información">
</form></body></html>

Productos Cantidad P/und Toatal
Camiseta 1 42-€ 42
Sudadera 3 34-€ 105
Pantalon 2 23-€ 46
Calzado 1 27-€ 27
Calcetines 5 12-€ 60
TOTAL: 280-€


Nombre
Apellidos
Correo
Comentarios