Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/11/2010, 08:18
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 1 mes
Puntos: 574
Respuesta: segun radiobuttons abre diferentes paginas

Código HTML:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <title>Documento sin t&iacute;tulo</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <script language="javascript">
  5. function verificar(obj){
  6.     var radioLength = obj.length;
  7.     if(radioLength == undefined){
  8.         if(obj.checked){
  9.             aux=obj.value;
  10.         }else{
  11.             aux="";
  12.         }
  13.     }else{
  14.         for(var i = 0; i < radioLength; i++) {
  15.             if(obj[i].checked) {
  16.                 aux=obj[i].value;
  17.             }
  18.         }
  19.     }
  20.     switch (aux){
  21.     case "1":
  22.         document.location="http://www.midominio.com";
  23.     break;
  24.     case "2":
  25.         document.location="http://www.midominio.com";
  26.     break;
  27.     case "3":
  28.         document.location="http://www.midominio.com";
  29.     break;
  30.    }
  31.         alert(aux);
  32. }
  33. </head>
  34. <form name="formulario" id="formulario" >
  35. <input name="precio" type="radio" value="1">De 1.00€ a 15.00€ <br />
  36. <input name="precio" type="radio" value="2">De 15.00€ a 25.00€ <br />
  37. <input name="precio" type="radio" value="3">De 25.00€ y más <br />
  38. <input name="enviar" type="submit" onClick="verificar(this.form.elements['precio'])" />
  39. </form>
  40. </body>
  41. </html>


Si?

Quim