Ver Mensaje Individual
  #12 (permalink)  
Antiguo 04/10/2010, 13:24
Avatar de bLEx
bLEx
 
Fecha de Ingreso: mayo-2008
Ubicación: Villa Alemana, Chile
Mensajes: 181
Antigüedad: 15 años, 11 meses
Puntos: 5
Respuesta: Enviar y recoger valor de lista desplegable por get

Buenas... y ahora te funciona??... bueno le hice algunos cambios y lo probé, en caso de que aún no te esta funcionando revisa el siguiente ejemplo.

index.php
Código HTML:
Ver original
  1. function cargarFormulario()
  2. {
  3.     var titulo = document.getElementById("texto").value;
  4.     var lista = document.getElementById("lista").options[document.getElementById("lista").selectedIndex].value;
  5.  
  6.     window.open("pagina.php?titulo="+titulo+"&opt="+lista+"" , "ventana1" , "width=120,height=300,scrollbars=NO");
  7.  
  8. }
  9.  
  10. <form method="post" action=""  onSubmit="cargarFormulario();">
  11.     <input type="text" id="texto">
  12.     <select id="lista">
  13.       <option value="valor1">Valor 1</option>
  14.       <option value="valori">Valor i</option>
  15.     </select>
  16.     <input type="submit" value="Enviar" id="enviar" name="enviar">
  17. </form>

pagina.php
Código PHP:
<?php
$titulo 
$_GET['titulo'];
$opt $_GET['opt'];

echo 
"El titulo es <b>$titulo</b> y la opcion seleccionada es <b>$opt</b>";
?>

Saludos