Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/02/2007, 05:43
xayide
 
Fecha de Ingreso: febrero-2006
Mensajes: 174
Antigüedad: 18 años, 2 meses
Puntos: 0
problemas para pasar valo radio button

Hola a todos. Tengo un problema que me está volviendo loca, y es una tontería, así que espero que alguien pueda ayudarme.

Tengo 3 radio buttons, que se llaman "opcion" y cada uno tiene un valor diferente: zona, precio, todos.

Cuando pulso un botón de tipo "button" quiero que se ejecute una pequeña función javascript que me abra otra pequeña ventana y se muestre el valor del radiobutton seleccionado.

Pues me da un error en la página y ni siquiera abre la ventana. Os pongo el código haber si alguien me puede ayudar. Gracias!!

Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<
title>Documento sin t&iacute;tulo</title>
<
style type="text/css">
<!--
.
Estilo1 {font-familyTahoma}
body {
    
background-color#FFFF99;
}
.
Estilo2 {font-familyTahomafont-weightbold; }
-->
</
style>
</
head>
<
script>
function 
buscar(){
    var 
i
    
for (i=0;i<document.form2.opcion.length;i++){
       if (
document.form2.opcion[i].checked)
        break;
    
    }
   
window.open('criteriobusqueda.php?opcion='+opcion[i].value,'vent','resizable=yes,width=600,height=255');
}
</script> 

<body>
<form action="" method="post" name="form2">
<div id="Layer1" style="position:absolute; left:103px; top:51px; width:835px; height:293px; z-index:1; background-color: #FFCC00; layer-background-color: #FFCC00; border: 1px none #000000;">
  <p class="Estilo1">Seleccione el criterio de b&uacute;squeda para buscar ofertas :</p>
  <table width="320" border="1">
    <tr>
      <td width="59" class="Estilo1"><label>
        <input name="opcion" type="radio" value="zona" />
      </label></td>
      <td width="245" class="Estilo1"><strong>
        <label>ZONA:</label>
      </strong></td>
    </tr>
    <tr>
      <td class="Estilo1"><label>
        <input name="opcion" type="radio" value="precio" />
      </label></td>
      <td class="Estilo1"><strong>
        <label>PRECIO ENTRE: </label>
      </strong></td>
    </tr>
    <tr>
      <td class="Estilo1"><label>
        <input name="opcion" type="radio" value="todos" />
      </label></td>
      <td class="Estilo2">TODOS LOS PISOS</td>
    </tr>
  </table>

  <p class="Estilo1">
    <label>
    <input type="button" name="" value="ACEPTAR" onclick="buscar()"/>
    </label>
</p>
</div>
</form>