Ver Mensaje Individual
  #3 (permalink)  
Antiguo 05/07/2010, 15:37
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Respuesta: Problemas con un popup!!! y actualizar pagina madre

Hola

A ver que te parece esto
Código ASP:
Ver original
  1. <head>
  2. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  3. <title>Sistema de Proyectos</title>
  4. <script language="javascript">
  5. function focos(){
  6. document.formidentifica.txtlgn.focus();
  7. }
  8.  
  9.  
  10.  
  11. function logeo()
  12. {
  13.     document.formidentifica.action="Aprobar logeo.asp";
  14.     document.formidentifica.submit();
  15. }
  16.  
  17. function cancelar()
  18. {
  19.     document.formidentifica.action="Aprobar.asp";
  20.     document.formidentifica.submit();
  21. }
  22. </script>
  23. <style>
  24. #txtlgn , #txtpwd
  25. {
  26. text-transform:uppercase;
  27. }
  28. </style>
  29. </head>
  30.  
  31. <body bgcolor="#F1ECC7" onload="focos()">
  32.  
  33. <% IF isEmpty(Request.Form("correo") OR  isEmpty(Request.Form("pass") Then %>
  34.  
  35. <table width="86%" border="0" cellspacing="0" cellpadding="3">
  36.   <tr>
  37.     <td height="22">&nbsp;</td>
  38.   </tr>
  39.   <tr>
  40.     <td height="217">
  41.         <table width="42%" height="134" border="1" align="center" bgcolor="#F4F8FF">
  42.           <tr>
  43.             <td height="128"><form id="form1" name="form1" method="post" action="Aprobar.asp">
  44.               <table width="98%" height="122" border="0" align="right">
  45.                 <tr>
  46.                   <td width="30%" class="style2"> <div align="center" class="style3">IONAME:</div></td>
  47.                   <td width="68%"><label>
  48.                    
  49.                     <input type="text" name="correo" />
  50.                     <span class="style3">@pg.com</span></label></td>
  51.                   <td width="2%" rowspan="2"></td>
  52.                 </tr>
  53.                 <tr>
  54.                   <td height="22" class="style2"> <div align="center" class="style3">PASSWORD:</div></td>
  55.                   <td><label>
  56.                    
  57.                     <div align="left">
  58.                       <input type="password" name="pass" />
  59.                     </div>
  60.                   </label></td>
  61.                 </tr>
  62.                 <tr>
  63.                   <td height="24" colspan="3">                  
  64.                     <div align="center">
  65.                       <input type="submit" name="Submit" value="Aceptar" />
  66.                     </div>
  67.                 </tr>
  68.                 <tr>
  69.                   <td height="20" colspan="3" class="error"><div align="center"><%=request.QueryString("mensaje")%></div></td>
  70.                 </tr>
  71.               </table>
  72.             </form>            </td>
  73.           </tr>
  74.       </table>
  75.         <hr width="30%" color="#006699" />
  76.     <p align="center">*Nota: El Password para ingresar al sistema, es el Password de intranet.</p>    </td>
  77.   </tr>
  78. </table>
  79.     </td>
  80.   </tr>
  81. </table>
  82.  
  83. <br />
  84. <br />
  85. <br />
  86.  <%
  87. ELSE ' haces la consulta
  88. ' si ha habido resultados
  89. %>
  90.  
  91. <script type="text/javascript">
  92. window.opener.document.getElementById('email').value ="<%=rs.Field("campo")%>";
  93. window.opener.document.getElementById('pass').value ="<%=rs.Field("campo")%>";
  94. self.close()
  95. </script>
  96.  
  97. <%
  98. End If
  99. ' cierras conexión
  100. END IF%>
  101.  
  102. <!-- Reconocimiento -->
  103. </body>
  104. </html>

  • En la línea 33 compruebas si recibes algo. En caso negativo, muestras el formulario
  • En la 43 el target del form es hacia la misma página que lo contiene
  • A partir de la línea 87, creo que se entiende

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;" />

Última edición por Adler; 05/07/2010 a las 15:43 Razón: comentar algunas líneas