Ver Mensaje Individual
  #9 (permalink)  
Antiguo 24/12/2009, 08:21
dpbataller
 
Fecha de Ingreso: agosto-2009
Mensajes: 134
Antigüedad: 15 años, 5 meses
Puntos: 3
Respuesta: Redirigir a disitntas webs dependiendo del radiobutton que eligas

NO funciona... perdona, pero no sé si hago algo mal ... es así como debe quedar el código?
Lo podrias probar tú haber si funciona?

Por cierto, mil gracias por toda la ayudaaaaaa!!!!

Código Javascript:
Ver original
  1. function entrar_buscador(){
  2.                     var i;
  3.                     var google = "http://www.google.es";
  4.                     var yahoo = "http://www.yahoo.es";
  5.                     var altavista = "http://www.altavista.es";
  6.                    
  7.                     for (i=0;i<document.formu.buscador.length;i++){
  8.                    
  9.                                 if(document.formu.buscador[i].value == "google"  ){
  10.                                     document.location.href=google;
  11.                                     break;
  12.                                 }
  13.                                
  14.                                 if(document.formu.buscador[i].value == "yahoo"  ){
  15.                                     document.location.href=yahoo;
  16.                                     break;
  17.                                 }
  18.                                
  19.                                 if(document.formu.buscador[i].value == "altavista"  ){
  20.                                     document.location.href=altavista;
  21.                                     break;
  22.                                 }
  23.                                
  24.                     }


Código HTML:
Ver original
  1. <form name="formu">
  2.                 <input type="radio" name="buscador" value="google" > Google
  3.                 <input type="radio" name="buscador" value="yahoo"   >  Yahoo
  4.                 <input type="radio" name="buscador" value="altavista"  > Altavista  
  5.                 <input type="button" value="Ir a..." onclick="entrar_buscador()">
  6.                
  7.             </form>