Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/07/2012, 05:04
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Select Menu/List Javascript IE

Me parece que te estás complicando las cosas

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <script type="text/javascript">
  7. //<![CDATA[
  8. function validar(){
  9. var elnombre = document.getElementById('nombre');
  10. if(elnombre.value == ""){
  11. alert('seleccione una opción');
  12. return false;
  13. }
  14. }
  15. //]]>
  16. </head>
  17. <form action="#" method="get" onsubmit="return validar()">
  18. <p>
  19. <select name="nombre" id="nombre">
  20. <option value="">Seleccionar</option>
  21. <option value="a">A</option>
  22. <option value="b">B</option>
  23. <option value="c">C</option>
  24. <input type="submit" />
  25. </p>
  26. </form>
  27. </body>
  28. </html>

Si bien no usé onchange, me gustar´´ia saber de donde has sacado eso de que onchange implica riesgos
SAludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.