Ver Mensaje Individual
  #2 (permalink)  
Antiguo 13/03/2003, 18:23
Avatar de Beakdan
Beakdan
 
Fecha de Ingreso: diciembre-2001
Ubicación: Monterrey, Nuevo León
Mensajes: 433
Antigüedad: 22 años, 4 meses
Puntos: 7
Mikil:
Me tardé un poquito porque trataba de hacer compatible este código con NS, pero me he dado por vencido.
Funciona bien con IE6, espero que te pueda ayudar.
Código:
<HTML>
<HEAD>
<TITLE></TITLE>
<style>
#TablaDatos{border:1px solid #000000;}
#TablaDatos td{border:1px solid #000000;}
#TablaDatos th{border:1px solid #000000;}
#TablaDatos input{border:0px}
</style>
<script>
cont=1;
function agregaFila(){
  tempFila = document.getElementById('TablaDatos').insertRow();
  celda1 = tempFila.insertCell();
  celda1.innerHTML = ++cont;
  celda2 = tempFila.insertCell();
  celda2.innerHTML = '<input type="text" name="codigo' + cont + '">'
  celda3 = tempFila.insertCell();
  celda3.innerHTML = '<input type="text" name="cantidad' + cont + '">'
  tempInput = eval("document.form1.cantidad" + cont);
  tempInput.onkeydown = tabulador;
}

function tabulador(){
  if(event.keyCode==9){
    agregaFila();
  }
}

</script>
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<form name="form1" action="" metod="get">
<table id="TablaDatos" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <th>&nbsp;</th>
    <th>Código</th>
    <th>Cantidad</th>
  </tr>
  <tr>
    <td>1</td>
    <td><input type="text" name="codigo1"></td>
    <td><input type="text" name="cantidad1" onkeydown="tabulador()"></td>
  </tr>
<table>
<input type="submit" value="Enviar">
<form>
</BODY>
</HTML>
Saludos.