Ver Mensaje Individual
  #4 (permalink)  
Antiguo 13/06/2010, 13:20
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: Pueden ayudarme a hacer esto?

Hola

Adapta esto a lo que te ocupa

Código Javascript:
Ver original
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function abrir () {
  5. var ancho = parseInt(((screen.width) / 2) - 150);
  6. var alto = parseInt(((screen.height) / 2) - 150);
  7. window.open('Insertar_Datos_DesdePOPUP.php','popup','resizable=yes, top='+alto+', left='+ancho+', width=300 ,height=300,  menubar=no, scrollbars=no, status=no, titlebar=no, toolbar=no,directories=no');
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <a href="javascript:void(0);" target="popup" hreflang="es" title="Imagen del Producto" onclick="abrir1();">Abrir</a><br />
  13. <form name="form1">
  14. Razon: <input type="text" id="camp1" name="camp1" value="" /><br />
  15. Cliente: <input type="text" id="camp2" name="camp2" value="" /><br />
  16. Calle: <input type="text" id="camp3" name="camp3" value="" />
  17. </body>
  18. </html>

Insertar_Datos_DesdePOPUP.php
Código PHP:
Ver original
  1. <?php
  2. $razon = "Por que quiero";
  3. $cliente = 12;
  4. $calle = "Italia";
  5. ?>
  6. <html>
  7. <head>
  8. </head>
  9. <body>
  10. Estos serán los datos que se enviarán al form<br />
  11. Razon: <?php echo $razon?><br />
  12. Cliente: <?php echo $cliente?><br />
  13. Calle: <?php echo $calle?><br /><br />
  14. <a href="#na" target="popup" hreflang="es" title="Imagen del Producto" onclick="enviar_datos_cliente();">Enviar Datos Al Form</a>
  15. <script type="text/javascript">
  16. function enviar_datos_cliente(){
  17.         window.opener.document.form1.camp1.value ="<?php echo $razon?>";        
  18.         window.opener.document.form1.camp2.value ="<?php echo $cliente?>";            
  19.         window.opener.document.form1.camp3.value ="<?php echo $calle?>";
  20. self.close()
  21. }
  22. </script>
  23. </body>
  24. </html>

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />