Programación Web y Scripting > JavaScript

 Como Puedo Pasar Parametros A Un Iframe???

(1/1)

enchodebacon:
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 --- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="estilos/estilos.css" rel="stylesheet" type="text/css"> </head><body leftmargin="0" topmargin="10" marginwidth="0" marginheight="0"><%Set rs=Server.CreateObject("ADODB.Recordset")Set conn = Server.CreateObject("ADODB.Connection")conn.Open ("driver={SQL Server};server=osiris.servidoresdns.net;uid=qc392;pwd=2dmayo;database=qc392")sql="select * from tbl_niveles order by nivel asc"rs.open sql,conn,1,2%><script LANGUAGE="JavaScript">var pais1=new String;var pais2=new String;var URL=new String; function getPais() {   for (var i=0; i < document.form1.pais.length; i++)   {     if (document.form1.pais[i].selected)     {        pais1=document.form1.pais.value;      pais2=document.form1.pais.value;            if (document.form1.pais.value=="Bélgica")      {        pais1="belgica";        pais2="belgica";      }      else      {        if (document.form1.pais.value=="Estados Unidos")        {          pais1="EEUU";          pais2="USA";        }        else        {          if (document.form1.pais.value=="Rep. Checa")          {            pais1="rcheca";            pais2="rcheca";          }          else          {              if (document.form1.pais.value=="Sur de Asia")            {              pais1="Hong_kong";              pais2="hong";            }            else            {                if (document.form1.pais.value=="Reino unido")              {                pais1="RUnido";                pais2="UK";              }            }          }        }      }    }  }  URL="http://www.investinmadrid.com/tce_nuevo/fichas/" + pais1 + "/intro_ficha_" + pais2 + ".htm";  alert(URL);}function setURL(String URL1){  parent.principal.location.href=URL1;  arriba.location.href='http://www.investinmadrid.com/tce_nuevo/seleccion_ficha.asp';  }</script><form method="post" name="form1" action="URL" target="marco"> <!--+ "topFrame.frames.location.href='seleccion_ficha.asp'"--><TABLE width="808">  <TR>     <TD width="93" rowspan="2"></TD></td>     <TD width="702" valign="top" class="Lineacelda"><table width="798%" border="0" cellpadding="0" cellspacing="8">          <tr>             <td width="1">             <td valign="top" class="textopeq"> <table width="569" border="0" cellpadding="0" cellspacing="0">                <tr>                   <td> <p class="titulo">Seleccione el país del que desea                       ver información<br>                      <br>                    </p>                  <td> </td>              </table>              <table width="573">                <tr>                   <td width="152" class="textopeq">Elija area geográfica                   <td width="137"> <select class="Campotexto" name="pais">                      <%                  if not rs.eof then                    rs.movefirst                    response.write("<option value='Todos'>Todos los paises</option>")                    while not rs.eof                      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                        response.write("<option value='" & rs("nivel") & "'>" & rs("nivel") & "</option>")                      end if                      rs.movenext                    wend                  end if                  %>                    </select>                   <td width="160"><span class="textopeq">Si esta listo pulse</span>                   <td width="100"> <input name="button" type="submit" class="Boton" value="Aceptar" onClick="getPais()">               </table>          <tr>            <td>            <td width="798" valign="top" class="textopeq"><iframe name="marco" width="798" align="left" frameborder=0></iframe></table> </TABLE><p> </p></form> </body></html>  
me podeis decir donde esta el error???
Gracias de antemano.

Navegación

[0] Índice de Mensajes

Ir a la versión completa