Ver Mensaje Individual
  #2 (permalink)  
Antiguo 19/04/2013, 11:03
Avatar de hackjose
hackjose
 
Fecha de Ingreso: abril-2010
Ubicación: Edo Mexico
Mensajes: 1.178
Antigüedad: 14 años
Puntos: 131
Respuesta: Actualizar pagina al seleccionar valor select

Debes enviar el indice seleccionado al servidor y mandarlo de vuelta

Al recibir de nuevo el indice seleccionado lo usas para seleccionar con javascript el option correspondiente

Debes usar la propiedad selectedIndex

Código HTML:
Ver original
  1.  
  2. </head>
  3.  
  4.  
  5. <select id="list" onchange="verIndex();">
  6.     <option disabled="disabled" selected="selected">Elige un valor</option>
  7.     <option>1</option>
  8.     <option>2</option>
  9.     <option>3</option>
  10. <script type="text/javascript">
  11. function verIndex()
  12. {
  13.     var lista = document.getElementById("list");
  14.     var opcion = lista.selectedIndex;
  15.     alert("Elegiste la opcion con indice: " + opcion + "la cual contiene el valor: " + lista.options[opcion].firstChild.data);
  16. }
  17. </body>
  18. </html>
Salu2