Ver Mensaje Individual
  #4 (permalink)  
Antiguo 06/07/2010, 15:55
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 1 mes
Puntos: 126
Respuesta: mostrar nombre de usuario al actualizar un popup!!!

Hola

Un ejemplo de lo intento que entiendas

a.html
Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta name="http-equiv" content="Content-type: text/html; charset=UTF-8"/>
  5. <script type="text/javascript">
  6. function abrir () {
  7. var ancho = parseInt(((screen.width) / 2) - 150);
  8. var alto = parseInt(((screen.height) / 2) - 150);
  9. window.open('a.asp','popup','resizable=yes, top='+alto+', left='+ancho+', width=300 ,height=300,  menubar=no, scrollbars=no, status=no, titlebar=no, toolbar=no,directories=no');
  10. }
  11. </script>
  12. </head>
  13. <body>
  14. <a href="javascript:void(0);" target="popup" hreflang="es" onclick="abrir();">Abrir POPUP</a><br />
  15. <form name="form1">
  16. Nombre: <div id="nombre"></div>
  17. Fecha: <div id="fecha"></div>
  18. </body>
  19. </html>
a.asp
Código ASP:
Ver original
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function enviar_datos_cliente(){
  5.         window.opener.document.getElementById("nombre").innerHTML ="<%=Request.Form("nombre")%>";        
  6.         window.opener.document.getElementById("fecha").innerHTML ="<%=Date()%>";            
  7. self.close()
  8. }
  9. </script>
  10. </head>
  11. <body>
  12. <% if Request.Form("nombre") = "" then%>
  13. <form action="a.asp" method="post">
  14. <input type="text" value="" name="nombre" /><br />
  15. <input type="submit" value="Enviar" />
  16. </form>
  17. <%
  18. else
  19. %>
  20.  
  21. <script type="text/javascript">
  22. enviar_datos_cliente()
  23. </script>
  24. <%end if%>
  25. </body>
  26. </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;" />