Todos los items los recogere despues con un php y los enviare a un correo. Espero puedan ayudarme
Código :
<html> <head> <title></title> <script> function calculo(cantidad,precio,inputtext){ subtotal = cantidad*precio; inputtext.value=subtotal; } </script> <body> <blockquote> <form> <tr><td><table width="29%" border="0"> <tr> <td width="10%">Cantidad</td> <td width="25%">Producto</td> <td width="12%">Valor</td> <td width="53%">Total</td> </tr> <tr> <td><input name="Cantidad1" type="text" id="cantidad" onChange="calculo(this.value,valor.value,subtotal,total);" value="0" size="5"></td> <td><input name="Producto1" type="text" id="producto" size="50"></td> <td><input name="Valor1" type="text" id="valor" onChange="calculo(this.value,valor.value,subtotal,total);" size="10"></td> <td><input name="subtotal1" type="text" id="subtotal" disabled="disabled" value="0" size="10"></td> </tr> <tr> </tr> <tr> <td><input name="Cantidad2" type="text" id="cantidad" onChange="calculo(this.value,valor.value,subtotal,total);" value="0" size="5"></td> <td><input name="Producto2" type="text" id="Producto" size="50"></td> <td><input name="Valor2" type="text" id="valor" onChange="calculo(this.value,valor.value,subtotal,total);" size="10"></td> <td><input name="subtotal2" type="text" id="subtotal" disabled="disabled" value="0" size="10"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td><input name="text3" type="text" id="total" value="0" size="10"></td> </tr> </table> </td> </tr> </form> </blockquote> </body> </html>
Este era el codigo inicial, pero el cliente me pidio que multiplicara cantidadxvalor
Código :
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <script type="text/javascript"> function sumacantidad(){interval = setInterval("calcular1()",1);} function calcular1(){ sc1 = document.form1.can1.value; sc2 = document.form1.can2.value; sc3 = document.form1.can3.value; document.form1.totalcant.value = (sc1 * 1) + (sc2 * 1) + (sc3 * 1);} function nosumacantidad(){clearInterval(interval);} </script> <script type="text/javascript"> function sumatotal(){interval = setInterval("calcular2()",1);} function calcular2(){ st1 = document.form1.valt1.value; st2 = document.form1.valt2.value; st3 = document.form1.valt3.value; document.form1.totalbruto.value = (st1 * 1) + (st2 * 1) + (st3 * 1);} function nosumatotal(){clearInterval(interval);} </script> <style type="text/css"> <!-- body { background-color: #253847; } body,td,th { color: #FFFFFF; } .Estilo1 { font-weight: bold; color: #253847; } .Estilo2 {color: #253847} --> </style></head> <body> <form id="form1" name="form1" method="post" action="send.php"> <label></label> <table width="588" border="0" align="center"> <tr> <td height="13" colspan="4" bgcolor="#253847"><div align="center" class="Estilo1">.</div></td> </tr> <tr> <td width="157" bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Señores</span></strong></div></td> <td colspan="3" bgcolor="#20303E"><div align="left"><strong> <input name="senores" type="text" id="senores" size="30" maxlength="100" /> </strong></div></td> </tr> <tr> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Direccion</span></strong></div></td> <td colspan="3" bgcolor="#20303E"><div align="left"><strong> <input name="direccion" type="text" id="direccion" size="30" maxlength="100" /> </strong></div></td> </tr> <tr> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Rut</span></strong></div></td> <td width="180" bgcolor="#20303E"><div align="left"><strong> <input name="rut" type="text" id="rut" size="30" maxlength="100" /> </strong></div></td> <td width="53" bgcolor="#20303E"><div align="left"></div></td> <td width="180" bgcolor="#20303E"><div align="left"></div></td> </tr> <tr> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Ciudad</span></strong></div></td> <td bgcolor="#20303E"><div align="left"><strong> <input name="ciudad" type="text" id="ciudad" size="30" maxlength="100" /> </strong></div></td> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Giro</span></strong></div></td> <td bgcolor="#20303E"><div align="left"> <input name="giro" type="text" id="giro" size="30" maxlength="100" /> </div></td> </tr> <tr> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Comuna</span></strong></div></td> <td bgcolor="#20303E"><div align="left"><strong> <input name="comuna" type="text" id="comuna" size="30" maxlength="100" /> </strong></div></td> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Fono</span></strong></div></td> <td bgcolor="#20303E"><div align="left"> <input name="fono" type="text" id="fono" size="30" maxlength="100" /> </div></td> </tr> <tr> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Condiciones de pago </span></strong></div></td> <td bgcolor="#20303E"><div align="left"><strong> <input name="condicionespago" type="text" id="condicionespago" size="30" maxlength="100" /> </strong></div></td> <td bgcolor="#20303E"><div align="left"><strong><span class="Estilo20">Contacto</span></strong></div></td> <td bgcolor="#20303E"><div align="left"> <input name="contacto" type="text" id="contacto" size="30" maxlength="100" /> </div></td> </tr> <tr> <td><div align="left" class="Estilo22 Estilo2"><strong>.</strong></div></td> <td><span class="Estilo22 Estilo2"><strong>.</strong></span></td> <td><span class="Estilo22 Estilo2"><strong>.</strong></span></td> <td><span class="Estilo22 Estilo2">.</span></td> </tr> </table> <table width="577" border="0" align="center" bgcolor="#20303E"> <tr> <td width="51"><div align="left" class="Estilo21"><strong><span class="Estilo15">Cantidad</span></strong></div></td> <td width="317"><div align="left" class="Estilo21"><strong><span class="Estilo15">Descripción</span></strong></div></td> <td width="95"><div align="left" class="Estilo21"><strong><span class="Estilo15">Valor Unitario </span></strong></div></td> <td width="96"><div align="left" class="Estilo21"><strong><span class="Estilo15">Valor Total </span></strong></div></td> </tr> <tr> <td><input name="can1" type="text" id="can1" size="5" onFocus="sumacantidad();" onBlur="nosumacantidad();" /></td> <td><input name="des1" type="text" id="des1" size="50" /></td> <td><input name="valu1" type="text" id="valu1" size="8" /></td> <td><input name="valt1" type="text" id="valt1" size="10" onFocus="sumatotal();" onBlur="nosumacantidad();" /></td> </tr> <tr> <td><input name="can2" type="text" id="can2" size="5" onFocus="sumacantidad();" onBlur="nosumacantidad();"/></td> <td><input name="des2" type="text" id="des2" size="50" /></td> <td><input name="valu2" type="text" id="valu2" size="8" /></td> <td><input name="valt2" type="text" id="valt2" size="10" onFocus="sumatotal();" onBlur="nosumacantidad();" /></td> </tr> <tr> <td><input name="can3" type="text" id="can3" size="5" onFocus="sumacantidad();" onBlur="nosumacantidad();"/></td> <td><input name="des3" type="text" id="des3" size="50" /></td> <td><input name="valu3" type="text" id="valu3" size="8" /></td> <td><input name="valt3" type="text" id="valt3" size="10" onFocus="sumatotal();" onBlur="nosumacantidad();" /></td> </tr> <tr> <td> </td> <td> </td> <td bgcolor="#2B4053"><span class="Estilo31">Cant Productos </span></td> <td bgcolor="#2B4053"><input name="totalcant" type=text id="totalcant" size="10"></td> </tr> <tr> <td> </td> <td> </td> <td bgcolor="#2B4053"><span class="Estilo31">Total Bruto </span></td> <td bgcolor="#2B4053"><input name="totalbruto" type=text id="totalbruto" size="10"></td> </tr> <tr> <td> </td> <td> </td> <td bgcolor="#2B4053"><input type="submit" name="Submit" value="Enviar" /></td> <td> </td> </tr> </table> </form> <label></label> </body> </html>