Ver Mensaje Individual
  #6 (permalink)  
Antiguo 10/06/2011, 09:26
tumbero_x
 
Fecha de Ingreso: octubre-2010
Ubicación: Buenos Aires
Mensajes: 557
Antigüedad: 13 años, 5 meses
Puntos: 4
Respuesta: Aplicar each a una funcion

la funcion que puse mas arriba anda perfecto ,pero unicamente cuando el usuario genera las filas
yo queria usar la misma funcion modificada para que funcione tambien cuando las filas de la tabla html se generen dinamicamente
pongo el html
Código HTML:
Ver original
  1. <body onLoad="actualizarIVA(document.getElementById('ivaso').value,+document.getElementById('iv').value)">
Código PHP:
Ver original
  1. echo '<tr>';
  2. echo '<input type="hidden" name="compra_arti_id[]" value="'.$compra_arti_id[$i].'">';
  3. echo '<input type="hidden" name="compra_descripcion[]" value="'.$fila['descripcion'].'">';
  4. echo '<input type="hidden" name="compra_cod_art[]" value="'.$fila['articulo_id'].'">';
  5. echo '<td style="width:7%; ">' .$fila['articulo_id'].'</td>';
  6. echo '<td style="width:10%;">' .$fila['ean'].'</td>';
  7. echo '<td style="width:30%;">'.$fila['descripcion'].'</td>';
  8. echo '<td style="width:8%;" >'.$compra_proce[$i].'<input type="hidden" name="compra_proce[]" value="'.$compra_proce[$i].'" ></td>';
  9. echo '<td style="width:5%; ">'.$compra_gar_art[$i].'<input type="hidden" name="compra_gar_art[]" value="'.$compra_gar_art[$i].'"></td>';
  10. echo '<td style="width:4%; ">'.$stk_suc[$i].'<input type="hidden" name="stk_suc[]" value="'.$stk_suc[$i].'"></td>';
  11. echo '<td style="width:4%; ">'.$compra_cantidad[$i].'<input type="hidden" name="compra_cantidad[]" value="'.$compra_cantidad[$i].'"></td>';
  12. echo '<td style="width:8%; ">'.number_format($compra_precio[$i], 2).'<input type="hidden" name="compra_precio[]" value="'.$compra_precio[$i].'"></td>';
  13. echo '<td style="width:5%; ">'.$fila['iva_detalle'].'<input type="hidden" name="compra_iva_det[]" [U]id="ivaso"[/U] value="'.$fila['iva_detalle'].'"></td>';
  14. echo '<td style="width:8%; ">'.number_format($compra_iva[$i], 2).'<input type="hidden"[COLOR="Red"]id="iv"[/COLOR] name="compra_iva[]"  value="'.$compra_iva[$i].'"></td>';
  15. echo '<td style="width:8%; ">'.number_format($tl, 2).'<input type="hidden" name="compra_subtotal[]" value="'.$tl.'"></td>';
  16. echo '<td style="width:3%;text-align:center "><a class="elimina" style="cursor:pointer"><img src="imagenes/delete.png" /></a></td>';
  17. echo '<td class="txt" style="display:none">'.$tl.'</td>';
  18. echo '<td class="iva" style="display:none">'.$compra_iva[$i].'</td>';
  19. echo '</tr>';