Tema: Tabla
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/03/2002, 22:37
Avatar de Kaopectate
Kaopectate
Colaborador
 
Fecha de Ingreso: diciembre-2001
Ubicación: Curaçao (Antillas Holandesas)
Mensajes: 3.179
Antigüedad: 22 años, 4 meses
Puntos: 38
Re: Tabla

Hola dimmi

Para hacer ese tipo de cosas yo uso un par de feames, uno donde yo le genero cada vez que quiero el contenido completo y otro dummy.

Prueba el siguiente ejemplo:

Código:
<html>
 <head>
  <script language="Javascript">
   var nResp = 0;
   var aResp = new Array("", "", "", "", "",
                         "", "", "", "", "",
                         "", "", "", "", "",
                         "", "", "", "", "");

   function escFormul(){
    with (frTrabajo){
     document.open();
     document.write("<html>");
     document.write("<head>");
     document.write("</head>");
     document.write("<body>");
     document.write("<form name='formulario'>");
     for (var i = 0; i < nResp; i++){
      document.write((i + 1) + "a pregunta: ");
      document.write("<input type='text' name='var" + i + "' value='" + aResp[i ] + "'><br>");
     }
     document.write("<br>");
     document.write("<input type='button' name='boton' value='agregar pregunta' onclick='parent.recalcula()'>");
     document.write("</form>");
     document.write("</body>");
     document.write("</html>");
     document.close();
    }
   }

   function recalcula(){
    nResp++;
    for (var i = 0; i < nResp - 1; i++){
     eval("aResp[i ] = frTrabajo.document.formulario.var" + i + ".value");
    }
    escFormul();
   }
  </script>
 </head>
 <frameset rows="*,0" onload="escFormul()">
  <frame name="frTrabajo" src="dummyPg.htm">
  <frame name="frDummy" src="dummyPg.htm">
 </frameset>
</html>
Cualquier duda me avisas.