• Sábado 27 de Abril de 2024, 01:42

Autor Tema:  Como Puedo Pasar Parametros A Un Iframe???  (Leído 1865 veces)

enchodebacon

  • Nuevo Miembro
  • *
  • Mensajes: 1
    • Ver Perfil
Como Puedo Pasar Parametros A Un Iframe???
« en: Miércoles 2 de Junio de 2004, 11:47 »
0
Hola, estoy haciendo una página para la comunidad de Madrid y tengo un formulario en el ke eligo un país y x una función ke he creado yo, al aceptar se contruye una URL ke es la ke kiero pasarle al iframe. Mi código es este:
Código: Text
  1.  
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  3. <html>
  4. <head>
  5. <title>Untitled Document</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  7. <link href="estilos/estilos.css" rel="stylesheet" type="text/css">
  8.  
  9. </head>
  10. <body leftmargin="0" topmargin="10" marginwidth="0" marginheight="0">
  11. <%
  12. Set rs=Server.CreateObject("ADODB.Recordset")
  13. Set conn = Server.CreateObject("ADODB.Connection")
  14. conn.Open ("driver={SQL Server};server=osiris.servidoresdns.net;uid=qc392;pwd=2dmayo;database=qc392")
  15. sql="select * from tbl_niveles order by nivel asc"
  16. rs.open sql,conn,1,2
  17. %>
  18. <script LANGUAGE="JavaScript">
  19. var pais1=new String;
  20. var pais2=new String;
  21. var URL=new String;
  22.  
  23. function getPais()
  24. {
  25.   for (var i=0; i < document.form1.pais.length; i++)
  26.   {
  27.     if (document.form1.pais[i].selected)
  28.     {  
  29.       pais1=document.form1.pais.value;
  30.       pais2=document.form1.pais.value;
  31.      
  32.       if (document.form1.pais.value=="Bélgica")
  33.       {
  34.         pais1="belgica";
  35.         pais2="belgica";
  36.       }
  37.       else
  38.       {
  39.         if (document.form1.pais.value=="Estados Unidos")
  40.         {
  41.           pais1="EEUU";
  42.           pais2="USA";
  43.         }
  44.         else
  45.         {
  46.           if (document.form1.pais.value=="Rep. Checa")
  47.           {
  48.             pais1="rcheca";
  49.             pais2="rcheca";
  50.           }
  51.           else
  52.           {  
  53.             if (document.form1.pais.value=="Sur de Asia")
  54.             {
  55.               pais1="Hong_kong";
  56.               pais2="hong";
  57.             }
  58.             else
  59.             {  
  60.               if (document.form1.pais.value=="Reino unido")
  61.               {
  62.                 pais1="RUnido";
  63.                 pais2="UK";
  64.               }
  65.             }
  66.           }
  67.         }
  68.       }
  69.     }
  70.   }
  71.   URL="http://www.investinmadrid.com/tce_nuevo/fichas/" + pais1 + "/intro_ficha_" + pais2 + ".htm";
  72.   alert(URL);
  73. }
  74. function setURL(String URL1)
  75. {
  76.   parent.principal.location.href=URL1;
  77.   arriba.location.href='http://www.investinmadrid.com/tce_nuevo/seleccion_ficha.asp';
  78.  
  79. }
  80. </script>
  81. <form method="post" name="form1" action="URL" target="marco"> <!--+ "topFrame.frames.location.href='seleccion_ficha.asp'"-->
  82. <TABLE width="808">
  83.   <TR>
  84.     <TD width="93" rowspan="2"></TD></td>
  85.     <TD width="702" valign="top" class="Lineacelda"><table width="798%" border="0" cellpadding="0" cellspacing="8">
  86.           <tr>
  87.             <td width="1">
  88.             <td valign="top" class="textopeq"> <table width="569" border="0" cellpadding="0" cellspacing="0">
  89.                 <tr>
  90.                   <td> <p class="titulo">Seleccione el país del que desea
  91.                       ver información<br>
  92.                       <br>
  93.                     </p>
  94.                   <td> </td>
  95.               </table>
  96.               <table width="573">
  97.                 <tr>
  98.                   <td width="152" class="textopeq">Elija area geográfica
  99.                   <td width="137"> <select class="Campotexto" name="pais">
  100.                       <%
  101.                   if not rs.eof then
  102.                     rs.movefirst
  103.                     response.write("<option value='Todos'>Todos los paises</option>")
  104.                     while not rs.eof
  105.                       if rs("nivel")<>"Todos" and rs("nivel")<>"Suecia" and rs("nivel")<>"Tailandia" and rs("nivel")<>"Dinamarca" and rs("nivel")<>"Francia" and rs("nivel")<>"India" and rs("nivel")<>"Italia" and rs("nivel")<>"Japón" and rs("nivel")<>"Rumanía" and rs("nivel")<>"Turquía" then
  106.                         response.write("<option value='" & rs("nivel") & "'>" & rs("nivel") & "</option>")
  107.                       end if
  108.                       rs.movenext
  109.                     wend
  110.                   end if
  111.                   %>
  112.                     </select>
  113.                   <td width="160"><span class="textopeq">Si esta listo pulse</span>
  114.                   <td width="100"> <input name="button" type="submit" class="Boton" value="Aceptar" onClick="getPais()">
  115.               </table>
  116.           <tr>
  117.             <td>
  118.             <td width="798" valign="top" class="textopeq">
  119. <iframe name="marco" width="798" align="left" frameborder=0></iframe></table>
  120. </TABLE>
  121. <p> </p></form>
  122.  
  123. </body>
  124. </html>
  125.  
  126.  

me podeis decir donde esta el error???
Gracias de antemano.