Ver Mensaje Individual
  #10 (permalink)  
Antiguo 15/01/2016, 14:47
__SDP__
 
Fecha de Ingreso: agosto-2010
Ubicación: santiago, CHILE
Mensajes: 564
Antigüedad: 13 años, 8 meses
Puntos: 9
Respuesta: Botón submit para selects anidados

sorry, ahora si este codigo funciona


Código HTML:
Ver original
  1.  
  2. function send_url(){
  3.         var opcion = document.getElementById('id-estados');
  4.         var estado = opcion[opcion.selectedIndex].getAttribute("rel");
  5.      
  6.       alert(estado);  
  7.  
  8.      
  9. }
  10.  
  11. </head>
  12.  
  13.  
  14. <form action="" method="post" onsubmit="send_url(); return false;">
  15.  
  16.  
  17.     <select id="id-estados">
  18.         <option value="5000" rel="santiago">santiago</option>
  19.         <option value="5001" rel="concepcion">concepción</option>
  20.     </select>
  21.     <input type="submit" value="enviar">
  22. </form>
  23.  
  24.  
  25. </body>