Ver Mensaje Individual
  #4 (permalink)  
Antiguo 22/02/2011, 09:52
omarMusic
 
Fecha de Ingreso: febrero-2011
Ubicación: Evolandia
Mensajes: 103
Antigüedad: 13 años, 3 meses
Puntos: 10
Respuesta: select dinamico

La verdad no estoy seguro que un evento pueda ejecutar otro evento, talves si se puede q es lo mas seguro, pero yo te aconsejeria q lo hagas mas simple, digamos si quisieras mostrar el value del select en el evento onchange, tendrias q forzar q cuando se ejecute el evento onclick hacer una llamada a la función del evento onchange, algo asi:

Código HTML:
Ver original
  1.     <head>
  2.         <title></title>
  3.         <script type="text/javascript">
  4.             function cambiarselect() {
  5.                var select =  document.getElementById('select');
  6.                select.selectedIndex = 2;
  7.                mostraralert(select);
  8.             }
  9.             function mostraralert(select) {
  10.                 alert(select.value);
  11.             }
  12.         </script>
  13.     </head>
  14.     <body>
  15.         <select id="select" onchange="mostraralert(this)">
  16.             <option value="1">Opcion1</option>
  17.             <option value="2">Opcion2</option>
  18.             <option value="3">Opcion3</option>
  19.             <option value="4">Opcion4</option>
  20.         </select>
  21.         <input type ="button" value="..." onclick="cambiarselect()"/>
  22.     </body>
  23. </html>

Saludos!