hasta hay todo bien le colo un script que es de una suma automatica al cual al hacer el bucle para la fila nueva ya no me genera la suma ni la sumatoria total... alguien que me pueda ayudar he investidado y todavia no pasa lada dejo aqui el codigo espero me puedan ayudar
Código HTML:
Ver original
<script language="JavaScript" type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> <script language="javascript"> function abrirCaja() { posx=((screen.availWidth-320)/2) posy=((screen.availHeight-200)/2) eval("boxwindow=window.open('ticket.php','boxwindow','width=320,height=400,toolbar=0,directories=0,status=0,scrollbars=0,resize=0,menubar=0,screenx="+posx+",screeny="+posy+",left="+posx+",top="+posy+"')") } function Sumar(){ interval = setInterval("calcular()",1); } function calcular(){ uno = document.autoSumForm.valor.value; dos = document.autoSumForm.comision.value; document.autoSumForm.valortotal.value = (uno*1)+(dos*1); } function NoSumar(){ clearInterval(interval); } </script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> <!-- .Estilo1 {font-family: "Comic Sans MS"} .Estilo2 { font-weight: bold; font-size: 16px; } .Estilo3 { font-family: "Arial Black"; font-weight: bold; font-size: 24px; color: #FFF; text-align: center; } body { background-image: url(80.jpg); } .Estilo6 {font-family: "Comic Sans MS"; color: #000000; } .Estilo7 {font-size: 16px} .Estilo8 { color: #FFFFFF; text-align: center; } .style1 {font-size: 18px} --> </style> </head> <body> <form id="formulario1" name="autoSumForm" method="POST" action="guardar_factura.php"> <table width="100%" border="0"> <tr> <table width="100%" border="0"> <tr> </tr> <tr> <table id="vista-buttons.com:id14h1a" width=0 cellpadding=0 cellspacing=0 border=0> <tr> <td style="padding-bottom:11px" title ="FACTURACION"><a href="facturacion.php" onMouseDown='xpe("14h1ac");' onMouseOver='xpe("14h1ao");' onMouseOut='xpe("14h1an");'></a><a href="facturacion.php" onMouseDown='xpe("14h1ac");' onMouseOver='xpe("14h1ao");' onMouseOut='xpe("14h1an");'><img id="xpi_14h1a" src="index-files/bt14h1a_0.gif" name="vb14h1a" width="180" height="39" border="0" alt="FACTURACION"/></a></td> </tr> <tr> </tr> <tr> </tr> <tr> </tr> </table> <noscript> <tr> </tr> <tr> <? for($i=1;$i<=20;$i++) { if($_GET["Line"] == $i) { $sel = "selected"; } else { $sel = ""; } ?> <?=$i;?> </option> <? } ?> </tr> <tr> </tr> <? $line = $_GET["Line"]; if($line == 0){$line=1;} for($i=1;$i<=$line;$i++) { ?> <tr> <td width="15%" class="Estilo1"><center> <select name="empresa<?=$i;?>"class="estilo1" id="empresa"> <input name="codigo<?=$i;?>" type="text" id="codigo" value="" size="10" maxlength="10" /> <input name="fecha<?=$i;?>" type="text" id="fecha" value="" size="20" maxlength="20" /> <input type="text"id="valor" onFocus="Sumar();" onBlur="NoSumar();" name="valor<?=$i;?>" value="" size="15" maxlength="15"> <input type="text" id="comision" onFocus="Sumar();" onBlur="NoSumar();" name="comision<?=$i;?>" value="" size="15" maxlength="15"> <div align="center"> <input type="text" class="Estilo6" id="valortotal" name="valortotal<?=$i;?>" size="15" maxlength="15" /> </div> </tr> <? } ?> <tr> </tr> <input name="Submit" type="submit" class="Estilo1" id="guardar" value="guardar"/> <input type="hidden" name="hdnLine" value="<?=$i;?>">

les agradesco mucho de antemano





Este tema le ha gustado a 1 personas