Ver Mensaje Individual
  #3 (permalink)  
Antiguo 11/03/2013, 14:32
julslash
 
Fecha de Ingreso: febrero-2010
Ubicación: valencia
Mensajes: 146
Antigüedad: 14 años, 3 meses
Puntos: 3
Respuesta: calcular operaciones con un valor cargado a un pop up desde un input

bueno como nadie supo como se hace aqui esta la solucion despues de darme golpes un rato contra la PC por si alguien lo necesita!!

pagina inicial formulario.php o cualquier otro nombre

Código PHP:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2.     "http://www.w3.org/TR/html4/loose.dtd">
  3.     <html xmlns="http://www.w3.org/1999/xhtml">
  4.         <head>
  5.             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.             <title>SITE</title>
  7.  
  8.   </HEAD>
  9.   <BODY>
  10. <form name="form1" method="post" action="">
  11. <br>
  12.  
  13.  
  14.   <input type="text" name="campo1" id="campo1">
  15. <br><br>
  16.   <input type="button" onClick="window.open('emergente.php?campo1=' + getElementById('campo1').value,'','height=600,width=500,location=1,scrollbars=1')" value="Abrir Emergente">
  17.  
  18.  
  19. </form>
  20.   </BODY>
  21.     </html>


pagina emergente.php

Código PHP:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2.     <html xmlns="http://www.w3.org/1999/xhtml">
  3.         <head>
  4.             <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5.             <title>SITE</title>
  6.  
  7.         </head>
  8.         <body>
  9.        
  10.  
  11.     <?php
  12.         // Se obtiene el valor pasado por el parametro 'par'
  13.         $var = $_GET['campo1'];
  14.         $d = (int)$var;
  15.        
  16.        
  17.         $i = 1;
  18.        while ($i <= $d) {
  19.        echo "<input type='text' size='15' name='edi".$i."' id='edi".$i."' value=' '/>";
  20.         echo $i++;
  21.         echo "<br>";       
  22. }
  23.     ?>
  24.  
  25.         </body>
  26.     </html>

funciona perfecto!!!!