![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
13/02/2008, 11:46
|
| | Fecha de Ingreso: febrero-2008
Mensajes: 2
Antigüedad: 17 años Puntos: 0 | |
Re: Agregar filas para insertar datos en un formulario Estoy mas o menos en las mismas, creo que soy menos experto que vos, pero te comparto mi código como lo llevo hasta el momento... depronto te sirve, aunque lo que quisiera es hacer una sumatoria de las columnas de las tablas...
Yo utilizo formularios con melodysoft... y el problema es que no sé como me puede enviar los datos de las tablas, aquí va mi código, espero que te sirva
<HTML>
<HEAD>
<TITLE>Prueba de formulario "Eselente"</TITLE>
<script language="JavaScript">
function A(form)
{
if (form.nombre.nombre == 0)
alert("Bien, "+form.neto.value+" ! La entrada es ok!")
var tx="<table border=1 cellpadding=”5” cellspacing=”0” width=”60%” summary=”Cotización en línea”><tr><td>"+form.equipos.options[form.equipos.selectedIndex].text+"<td>"+" $ "+" "+form.equipos.options[form.equipos.selectedIndex].value+"<td>"+document.formu.cantidad.value+""+" kg"+"<td>"+document.formu.neto.value+"</td></tr></table>";
document.body.innerHTML+=tx;
}
</script>
<SCRIPT LANGUAGE="JavaScript">
function ver(form) {
var num1, num2
var suma
document.formu.campo.value="$ "+(form.equipos.options[form.equipos.selectedIndex].value)
num1=(form.equipos.options[form.equipos.selectedIndex].value)
num2=document.formu.cantidad.value
suma=num1*num2
document.formu.neto.value = (suma)
} </SCRIPT>
<SCRIPT LANGUAGE="JavaScript">
function multi(form) {
var num1, num2
var suma
num1=(form.equipos.options[form.equipos.selectedIndex].value)
num2=document.formu.cantidad.value
suma=num1*num2
document.formu.neto.value = suma
} </SCRIPT>
</HEAD>
<BODY>
<FORM NAME="formu" form method="post" action="http://forms.melodysoft.com">
<input type="hidden" name="id" value="CÓDIGO_IDENTIFICATIVO_DEL_FORMULARIO">
Su nombre:<BR>
<input type="text" name="nombre" tabindex = "1">
<BR>
E-Mail:<BR> <input type="text" name="email" tabindex = "2">
<BR>
Empresa:<BR> <input type="text" name="email" tabindex = "3">
<BR>
Mensaje:<BR> <textarea name="mensaje" tabindex = "4"></textarea>
<BR>
Producto: <BR>
<SELECT NAME="equipos" onChange="ver(this.form)" tabindex = "5">
<option value="0">Escoja...</option>
<option value="1000">Pulmón</option>
<option value="2000">Corazón</option>
<option value="3500">Lengua</option>
<option value="2454">Hígado</option>
<option value="5879">Cayos</option>
<option value="6525">Criadillas</option>
</SELECT>
<BR>Precio Unitario:<BR> <input type="text" Name="campo" style="border:0;"><BR>
Cantidad (Kilos) :<BR> <INPUT TYPE="text" NAME = "cantidad" onKeyUp="multi(this.form)" tabindex = "6">Kg.<BR>
Subtotal: <BR><input type="text" Name="neto" value = 0 style="border:0;"><BR><BR>
<BR><BR><input type="submit" value="Enviar" tabindex = "8">
<input type="reset" value="Borrar" tabindex = "9"><BR><BR>
<input type="button" name="c" value="Agregar" onClick="A(this.form);"><BR><BR>
Cotización:<BR> <textarea name="mensaje1" tabindex = "10"></textarea><BR>
TOTAL COTIZACIÓN: <BR><input type="text" Name="total" value=0><BR><BR>
<BR>
</FORM>
</BODY>
</HTML> |